-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HTTP_PROXY support via global-agent is broken #3589
Comments
Also the documentation includes a small typo. The list of env var names that can be used for setting a https proxy includes the option |
Oh interesting. I haven't dug into this but would it be possible to submit a PR for this? |
Sorry, wish I could but work is pretty hectic at the mo so I don't really have time given the workaround is sufficient in our use case. But thought I should report this in case anyone else is running into it. |
Yeah appreciate it! |
Thank you for raising this one @callumgare! Definitely saved me loads of time when I hit the same issue. Your workaround doesn't seem to work anymore as My workaround was to add the following lines at the top of my
I also had to explicitly use |
The docs indicate that SST can be configured to use a HTTP proxy (https://docs.sst.dev/advanced/connecting-via-proxy) however I believe this is no longer works.
I'm running SST in an AWS EC2 instance that does not have direct access to the internet. All external traffic must pass though a HTTP proxy. I have verified this behaviour works as expected since without supplying the proxy details via the env vars
http_proxy
andhttps_proxy
then runningcurl http://example.com
andcurl https://example.com
will result in a timeout (curl: (28) Failed to connect to example.com port 80 after 129952 ms: Connection timed out
). However when these vars are specified the curl command runs fine.The SST documentation states that it can be setup to use a http proxy by first installing the
global-agent
package (which I have done) and setting one of a list of env vars for http traffic and https traffic. I've tried numbers of combinations but am currently usingGLOBAL_AGENT_HTTPS_PROXY
andGLOBAL_AGENT_HTTP_PROXY
set to the same values as thehttp_proxy
andhttps_proxy
env vars I was using to configure curl.As far as I can tell this should be sufficient however that doesn't seem to work:
Thanks for reading!
Digging a little deeper I found the PR that added proxy support in the first case. It appears the actual code changes which called global-agent if the package was installed was lost in the transition between v1 and v2 (https://github.com/sst/sst/tree/v1.18.4/packages/core/src vs https://github.com/sst/sst/tree/v2.0.0/packages/sst/src).
Workaround
For anyone else running into this issue I found you can call global-agent youself by running sst with
node -r 'global-agent/bootstrap' ./node_modules/.bin/sst
. So instead of the commandsst deploy --stage prod
you'd usenode -r 'global-agent/bootstrap' ./node_modules/.bin/sst deploy --stage prod
.The text was updated successfully, but these errors were encountered: