Closed pkazmier closed 10 years ago
This feature request seems more appropriate for Atom itself and not for this particular package. Feel free to open an issue in their repo.
Atom does support working behind a proxy. They honor the http_proxy environment variable. Your use of https.request does not, however, as it assumes a direct connection.
I can take a look later. So basically you are asking to check for the presence of the http_proxy
env variable before making the request and it use for the request. What about the port? Is http_proxy
a common practice? I don't want to add support for this if it could break regular users that have the env variable set "by mistake" to favor a few who actually use it.
Re-opening for now while I investigate.
Yes, http_proxy
is a well known environment variable honored by many tools. The format of the value is [protocol://]<host>[:port]
. For example, proxy.example.com:8000
. If a user has this variable defined, then any requests should be made via the proxy server. I'm not very familiar with the node landscape, but after a quick google, it looks like there are essentially two options:
Thanks, Pete
I'll try to make the switch to request. Seems like the easiest solution.
Hopefully https://github.com/Chris911/Ask-Stack-Atom/commit/35a505a146fcf16c3454f705a440f0587e405625 should do it. The request
library supposedly supports http_proxy
so it should fix your issue. Also got rid of the gzip decompressing code which is now handled by the library (good stuff).
I just updated the package to v0.0.7 let me know if it works out for you.
It does not look like request
supports the automatic use of http_proxy
as a packet capture on my local machine confirms it's still trying to directly connect to stackexchange without the use of my defined proxy. I think you'll need to add this line before your call to request
to set the proxy if it is defined.
options.proxy = process.env.http_proxy if process.env.http_proxy?
I'll try that. Kinda hard for me to test because I don't use a proxy and don't really want to start playing with that. When you download the package the code is available at ~/.atom/packages
so if you want to try and add that line and submit a pull request it would really help.
Please add proxy support to Ask Stack for those of us who are stuck behind great corporate firewalls ...