ternjs / tern_for_sublime

Sublime Text package adding Tern support
MIT License
803 stars 54 forks source link

Proxy support #24

Closed deizel closed 11 years ago

deizel commented 11 years ago

Just a heads up...

When I make a new *.js file and press 'a', I get this error message from what looks like my corporate proxy server:

tern_for_sublime-proxy-erro

IIRC, Package Control seems to use the system proxy settings correctly out of the box.

I'm not really sure what is going on here as I can't see the <body> of the error message.

marijnh commented 11 years ago

I'm not too knowlegeable on how proxies work, but Tern is trying to connect to localhost here, I don't think the proxy kicking in for local connections is a very sane thing. It definitely won't work, even with proper proxy settings (the proxy server won't know what localhost is).

deizel commented 11 years ago

Ah, that makes sense - I see now where it tries to connect to localhost.

According to the Python documentation (v2/v3)

I'm not at my work machine to try it right now, but it would seem the latter is the way to go here.

marijnh commented 11 years ago

Indeed (though I'm still amazed that it would look at proxy settings at all when connecting to localhost). Can you report on whether adding that argument helps? If so, I'll add it to the code (both here and in the vim plugin).

deizel commented 11 years ago

So, the suggested changes did the trick here for me - see pull request.

I did find afterwards that setting the Unix-like NO_PROXY environment variable was another solution:

windows-no_proxy

However, there may be other corporate users like me that don't have control over their proxy settings (inetcpl.cpl and regedit.exe are locked down).