Friday, December 27, 2013

Setting proxy in Brackets(code editor for the Web).

Brackets
Brackets
Brackets is an open source code editor for the web. It's entirely developed using JavaScript, HTML and CSS by web developers like you. It's one of my favourite code editors besides WebStorm,PyCharm,Bluefish,etc..

As Brackets didn't provide the GUI interface for setting PROXY and PORT, you need to hack around a little bit  in the SOURCE CODE of the Brackets. I've already hacked it so this article provides you the details on setting the PROXY for Brackets. You can download the source code from GitHub.

you can use the command :

                 git clone https://github.com/adobe/brackets

or simply download the zip file from there.

Brackets does't work on Debian-7(wheezy) due to glibc version incompatibility, so to use Brackets in Wheezy, please download this test build Brackets-sprint-34. This release solves the bug  #4816 for glibc version incompatibility.

Let's set the proxy in Brackets.
Brackets is installed in /opt/brackets in Linux
So goto  /opt/brackets/www/extensibility/node/ExtensionManagerDomain.js

or by using the command in terminal :

               gedit /opt/brackets/www/extensibility/node/ExtensionManagerDomain.js


If you are using Brackets-sprint-34, then goto line number 382 and look for the function _cmdDownloadFile(downloadId, url, callback)   and 

change the line :
var req = request.get({
        url: url,
        encoding: null
    },

to

var req = request.get({
        proxy: 'http://proxy.adrress:port',
        url: url,
        encoding: null
    },

Here's a Screenshot :



if your proxy requires authentication then it should be like this :

var req = request.get({
        proxy: 'http://username:password@proxy.adrress:port',
        url: url,
        encoding: null
    },


for example :
var req = request.get({
        proxy: 'http://127.0.0.1:8080',
        url: url,
        encoding: null
    },

That's it, save the file and restart the Brackets. Now, you'll be able to install plugins.
If you have got any problem just throw a comment, i'll try to help you.  







10 comments:

Unknown said...

Thanks!

Ber said...

Not working with Brackets 1.0. The function was changed as to receive a pre-configured proxy var, or call it if it is a function. Didn't figured it out yet.

Riki said...

Search for "proxy" at: https://github.com/adobe/brackets/wiki/How-to-Use-Brackets#preferences
It worked for me :)

Ber said...

Didn't work.. but lead me to the answer! What I wanted was for brackets to load the pages within "localhost" at port 216, where my node server is listening.

There it said to create a ' "proxy": "http://localhost:216/" ' line, which did nothing. However you can go to help/preferences, where you can do it with an UI. After configuring, the preferences file showed these lines:

"proxy": "http://:@localhost:216"
"prefUI.proxy-enabled": true,
"prefUI.proxy-string": "http://:@localhost:216",

However, brackets would still open pages in a random port. What solved the problem was to specify the 'static server port', in the same UI or by adding the line "staticserver.port": "216"

admin said...

Would like to see some other posts on the same subject! easy way to remember trig identities

official said...

I have enjoyed reading your post first time. old showbox apk

tike mik said...

Besides injury treatment, it also focuses on helping the athletes improve their performance prevent future injuries.
dart board backboards

Lifelink said...
This comment has been removed by the author.
Lifelink said...

You have done a great job. I will definitely dig it and personally recommend to my friends. I am confident they will be benefited from this site. vpn

hajikhatri said...

I wanted to leave a little comment to support you and wish you a good continuation. Wishing you the best of luck for all your blogging efforts. vpn free

Post a Comment