feature: Add support for HTTP_PROXY, HTTPS_PROXY, and NO_PROXY#1260
feature: Add support for HTTP_PROXY, HTTPS_PROXY, and NO_PROXY#1260
Conversation
keegancsmith
left a comment
There was a problem hiding this comment.
Nice! Inline comments, but otherwise LGTM
|
You might wanna rebase, I think william just did some CI updates which include things like go-lint/etc. |
|
Thanks for all of your commentary; I forgot to open this PR in draft mode! Been trying to address what looks like flakey tests in the Ubuntu CI runner; I'll go through your very helpful comments soon. |
|
This change is part of the following stack: Change managed by git-spice. |
b1d6176 to
05f0fbb
Compare
|
@peterguy alright just re-request review when ready. |
622bd60 to
3536377
Compare
keegancsmith
left a comment
There was a problem hiding this comment.
Requesting changes since I just wanna re-review once you have addressed the comments. FYI I pushed some commits to resolve the CI issues.
|
I would wait for an update for Keegan's requested changes before doing my review pass if that's okay. |
6ab67e5 to
78eadd2
Compare
78eadd2 to
54aada1
Compare
cab95e8 to
97c1b0a
Compare
448305b to
a0d8f91
Compare
5ccd030 to
9ad25e5
Compare
a0d8f91 to
ed682d7
Compare
…tlsConn.Close()`) is necessary
…ng in the custom dialer
6259749 to
99ad843
Compare
|
Description is accurate, Added some better smoke tests that I think are important to guard against future changes to |
Adds support for the standard environment variables
HTTP_PROXY,HTTPS_PROXY, andNO_PROXY.SRC_PROXYstill takes precedence, including overNO_PROXY.Test plan
Added CI tests validating proxy connection behavior.
Manual testing
Install
mitmproxy,socatandsquid(brew install mitmproxy socat squidfor me).Create an SSL cert for
squid:Create a config for
squid:Launch three terminals to run the proxies:
socat -d -d unix-listen:${HOME}/src-proxy.sock,fork tcp:localhost:8080in one.mitmproxy -vin another.squid -f ${HOME}/squid.conf -N -d 1- in the third.In a fourth terminal, in the src-cli repo, build the binary:
go build -o ./src-cli ./cmd/srcEnsure you have
SRC_ENDPOINTandSRC_ACCESS_TOKENset in your environment, and unsetSRC_PROXY.SRC_ENDPOINTneeds to behttps://.Connect with each proxy (
mitmproxyis 8080,squidis 8445) and with no proxy:You should get 14 "Authenticated as [USER] on [ENDPOINT]" messages in your terminal. You should see four connections in
mitmproxy, six insquid, and several lines insocatindicating one connection.This test ensures:
SRC_PROXY,HTTPS_PROXY,NO_PROXY)NO_PROXYtrumpsHTTPS_PROXYSRC_PROXYtrumpsHTTPS_PROXYandNO_PROXYCleanup from the test:
rm -f ${HOME}/squid-proxy.pem ${HOME}/squid-key.pem ${HOME}/squid-cert.pem ${HOME}/squid.conf ${HOME}/src-proxy.sockCloses https://linear.app/sourcegraph/issue/CPL-236/src-cli-support-standard-http-proxy