[GH-ISSUE #305] External proxy support? #222

Closed
opened 2026-02-27 23:16:00 +03:00 by kerem · 8 comments
Owner

Originally created by @reyaz006 on GitHub (Aug 5, 2019).
Original GitHub issue: https://github.com/snail007/goproxy/issues/305

I have access to external HTTP/HTTPS proxy. This is a usual standalone proxy, which has nothing to do with goproxy. It looks like https://proxy-server-999.com:12345

I want to use goproxy to connect to it and open a local proxy on a port 54321. So, when I put 127.0.0.1:54321 in browser or other applications, it will connect to the internet through https://proxy-server-999.com:12345, using goproxy.

Is this possible?

I've tried these:

  1. proxy http -t tcp -p "0.0.0.0:54321" -T tcp -P "proxy-server-999.com:123453"
  2. proxy http -t tls -p "0.0.0.0:54321" -T tcp -P "proxy-server-999.com:123453" -C proxy.crt -K proxy.key
  3. proxy http -t tls -p "0.0.0.0:54321" -T tls -P "proxy-server-999.com:123453" -C proxy.crt -K proxy.key

But nothing worked. I'd like a simple example for the usage case I've described.

Thanks in advance.

Originally created by @reyaz006 on GitHub (Aug 5, 2019). Original GitHub issue: https://github.com/snail007/goproxy/issues/305 I have access to external HTTP/HTTPS proxy. This is a usual standalone proxy, which has nothing to do with goproxy. It looks like `https://proxy-server-999.com:12345` I want to use goproxy to connect to it and open a local proxy on a port 54321. So, when I put `127.0.0.1:54321` in browser or other applications, it will connect to the internet through `https://proxy-server-999.com:12345`, using goproxy. Is this possible? I've tried these: 1. `proxy http -t tcp -p "0.0.0.0:54321" -T tcp -P "proxy-server-999.com:123453"` 2. `proxy http -t tls -p "0.0.0.0:54321" -T tcp -P "proxy-server-999.com:123453" -C proxy.crt -K proxy.key` 3. `proxy http -t tls -p "0.0.0.0:54321" -T tls -P "proxy-server-999.com:123453" -C proxy.crt -K proxy.key` But nothing worked. I'd like a simple example for the usage case I've described. Thanks in advance.
kerem closed this issue 2026-02-27 23:16:01 +03:00
Author
Owner

@snail007 commented on GitHub (Aug 6, 2019):

try proxy http -t tcp -p "0.0.0.0:54321" -T tls -P "proxy-server-999.com:123453" --parent-tls-single , using the local is http://127.0.0.1:54321

<!-- gh-comment-id:518449105 --> @snail007 commented on GitHub (Aug 6, 2019): try `proxy http -t tcp -p "0.0.0.0:54321" -T tls -P "proxy-server-999.com:123453" --parent-tls-single` , using the local is http://127.0.0.1:54321
Author
Owner

@reyaz006 commented on GitHub (Aug 6, 2019):

I've tried this and it doesn't work, from what I see. After setting http://127.0.0.1:54321 as a browser HTTP proxy like that, when I visit IP detection services - I see my own IP address instead of the IP of proxy-server-999.com.

<!-- gh-comment-id:518525325 --> @reyaz006 commented on GitHub (Aug 6, 2019): I've tried this and it doesn't work, from what I see. After setting `http://127.0.0.1:54321` as a browser HTTP proxy like that, when I visit IP detection services - I see my own IP address instead of the IP of `proxy-server-999.com`.
Author
Owner

@snail007 commented on GitHub (Aug 6, 2019):

proxy http -t tcp -p "0.0.0.0:54321" -T tls -P "proxy-server-999.com:123453" --parent-tls-single --always

<!-- gh-comment-id:518538016 --> @snail007 commented on GitHub (Aug 6, 2019): proxy http -t tcp -p "0.0.0.0:54321" -T tls -P "proxy-server-999.com:123453" --parent-tls-single `--always`
Author
Owner

@snail007 commented on GitHub (Aug 6, 2019):

your upstream is really https proxy?

<!-- gh-comment-id:518538223 --> @snail007 commented on GitHub (Aug 6, 2019): your upstream is really `https proxy`?
Author
Owner

@reyaz006 commented on GitHub (Aug 6, 2019):

Now that you mention it, I'm not sure. When I set it up into SimpleProxy extension in browser, set it as HTTPS, it works. If I change it to HTTP, it stops working.

At the same time, if I set it through Windows control panel, it doesn't work at all.

Here is the error I see now after adding --always:

write to *** , err:x509: certificate signed by unknown authority

<!-- gh-comment-id:518579205 --> @reyaz006 commented on GitHub (Aug 6, 2019): Now that you mention it, I'm not sure. When I set it up into SimpleProxy extension in browser, set it as HTTPS, it works. If I change it to HTTP, it stops working. At the same time, if I set it through Windows control panel, it doesn't work at all. Here is the error I see now after adding `--always`: > write to *** , err:x509: certificate signed by unknown authority
Author
Owner

@snail007 commented on GitHub (Aug 6, 2019):

try curl -x http://upstreamIP:port https://www.google.com to check if the upstream is a http proxy

<!-- gh-comment-id:518614447 --> @snail007 commented on GitHub (Aug 6, 2019): try curl -x http://upstreamIP:port https://www.google.com to check if the upstream is a `http proxy`
Author
Owner

@reyaz006 commented on GitHub (Aug 6, 2019):

Well, it doesn't seems to work for me with curl.

  • ALPN, offering http/1.1
  • TLSv1.3 (OUT), TLS handshake, Client hello (1):
  • TLSv1.3 (IN), TLS handshake, Server hello (2):
  • TLSv1.2 (IN), TLS handshake, Certificate (11):
  • TLSv1.2 (OUT), TLS alert, unknown CA (560):
  • SSL certificate problem: unable to get local issuer certificate
    curl: (60) SSL certificate problem: unable to get local issuer certificate
    More details here: https://curl.haxx.se/docs/sslcerts.html

curl failed to verify the legitimacy of the server and therefore could not
establish a secure connection to it. To learn more about this situation and
how to fix it, please visit the web page mentioned above.

I've also tried following a guide about getting ROOT certificate and appending it in curl-ca-bundle.crt but it appears that curl ignores curl-ca-bundle.crt completely and I didn't find a way to force it to use it. I've tried latest curl build for Windows from https://curl.haxx.se/windows/

<!-- gh-comment-id:518642610 --> @reyaz006 commented on GitHub (Aug 6, 2019): Well, it doesn't seems to work for me with curl. > * ALPN, offering http/1.1 > * TLSv1.3 (OUT), TLS handshake, Client hello (1): > * TLSv1.3 (IN), TLS handshake, Server hello (2): > * TLSv1.2 (IN), TLS handshake, Certificate (11): > * TLSv1.2 (OUT), TLS alert, unknown CA (560): > * SSL certificate problem: unable to get local issuer certificate > curl: (60) SSL certificate problem: unable to get local issuer certificate > More details here: https://curl.haxx.se/docs/sslcerts.html > > curl failed to verify the legitimacy of the server and therefore could not > establish a secure connection to it. To learn more about this situation and > how to fix it, please visit the web page mentioned above. I've also tried following a guide about getting ROOT certificate and appending it in `curl-ca-bundle.crt` but it appears that curl ignores `curl-ca-bundle.crt` completely and I didn't find a way to force it to use it. I've tried latest curl build for Windows from https://curl.haxx.se/windows/
Author
Owner

@reyaz006 commented on GitHub (Aug 6, 2019):

Oh wait I now see that you are suggesting to test my proxy as http:// with curl. Here is the result:

  • allocate connect buffer!
  • Establish HTTP proxy tunnel to www.google.com:443

CONNECT www.google.com:443 HTTP/1.1
Host: www.google.com:443
User-Agent: curl/7.65.3
Proxy-Connection: Keep-Alive

  • Recv failure: Connection was reset
  • Received HTTP code 0 from proxy after CONNECT
  • CONNECT phase completed!
    curl: (56) Recv failure: Connection was reset

So I think it's not an HTTP proxy, but an HTTPS proxy.

<!-- gh-comment-id:518643218 --> @reyaz006 commented on GitHub (Aug 6, 2019): Oh wait I now see that you are suggesting to test my proxy as http:// with curl. Here is the result: > * allocate connect buffer! > * Establish HTTP proxy tunnel to www.google.com:443 > > CONNECT www.google.com:443 HTTP/1.1 > > Host: www.google.com:443 > > User-Agent: curl/7.65.3 > > Proxy-Connection: Keep-Alive > > > * Recv failure: Connection was reset > * Received HTTP code 0 from proxy after CONNECT > * CONNECT phase completed! > curl: (56) Recv failure: Connection was reset So I think it's not an HTTP proxy, but an HTTPS proxy.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/goproxy#222
No description provided.