[GH-ISSUE #153] 能否强制使用代理? #85

Closed
opened 2026-02-27 23:15:22 +03:00 by kerem · 2 comments
Owner

Originally created by @maxadd on GitHub (Sep 29, 2018).
Original GitHub issue: https://github.com/snail007/goproxy/issues/153

我使用了三级代理,客户端会将请求发送给一级代理,一级代理给二级,二级给三级。搭建完成后,测试了下整个链路是通的。但是某些时候在一级和二级上总会出现 use proxy: false,然后它自己处理请求,而没有将请求发送给上级代理,而我用 telnet 命令测试访问上级代理的端口没有问题。我看了下 proxy 命令也没有强制使用代理的选项,请问有啥办法么?

一级代理的启动命令为:

/usr/bin/proxy http -t tcp -p :53432 -T tls -P 122.232.122.115:11088 -C /etc/ssl/cert.pem -K /etc/ssl/key.pem

二级为:

/usr/bin/proxy http -t tls -p :11088 -T tls -P 67.210.192.124:6851 -C /etc/ssl/cert.pem -K /etc/ssl/key.pem -l 1m

一级代理的日志为:

2018/09/29 12:17:13 GET:HTTP://www.google.com/
2018/09/29 12:17:13 use proxy : false, www.google.com:80
2018/09/29 12:17:15 connect to  , err:dial tcp [2404:6800:4008:803::2004]:80: i/o timeout,retrying...
2018/09/29 12:17:19 connect to  , err:dial tcp [2404:6800:4008:803::2004]:80: i/o timeout,retrying...
2018/09/29 12:17:23 connect to  , err:dial tcp [2404:6800:4008:803::2004]:80: i/o timeout,retrying...
2018/09/29 12:17:27 connect to  , err:dial tcp 69.171.237.16:80: i/o timeout,retrying...
2018/09/29 12:17:31 connect to  , err:dial tcp [2404:6800:4008:803::2004]:80: i/o timeout,retrying...
2018/09/29 12:17:35 connect to  , err:dial tcp [2404:6800:4008:803::2004]:80: i/o timeout
2018/09/29 12:17:35 connect to tls parent  fail

而且我在客户端访问 www.google.com 的时候在一级代理上抓包,发现它并没有发送请求到二级代理。

Originally created by @maxadd on GitHub (Sep 29, 2018). Original GitHub issue: https://github.com/snail007/goproxy/issues/153 我使用了三级代理,客户端会将请求发送给一级代理,一级代理给二级,二级给三级。搭建完成后,测试了下整个链路是通的。但是某些时候在一级和二级上总会出现 `use proxy: false`,然后它自己处理请求,而没有将请求发送给上级代理,而我用 telnet 命令测试访问上级代理的端口没有问题。我看了下 proxy 命令也没有强制使用代理的选项,请问有啥办法么? 一级代理的启动命令为: /usr/bin/proxy http -t tcp -p :53432 -T tls -P 122.232.122.115:11088 -C /etc/ssl/cert.pem -K /etc/ssl/key.pem 二级为: /usr/bin/proxy http -t tls -p :11088 -T tls -P 67.210.192.124:6851 -C /etc/ssl/cert.pem -K /etc/ssl/key.pem -l 1m 一级代理的日志为: ``` 2018/09/29 12:17:13 GET:HTTP://www.google.com/ 2018/09/29 12:17:13 use proxy : false, www.google.com:80 2018/09/29 12:17:15 connect to , err:dial tcp [2404:6800:4008:803::2004]:80: i/o timeout,retrying... 2018/09/29 12:17:19 connect to , err:dial tcp [2404:6800:4008:803::2004]:80: i/o timeout,retrying... 2018/09/29 12:17:23 connect to , err:dial tcp [2404:6800:4008:803::2004]:80: i/o timeout,retrying... 2018/09/29 12:17:27 connect to , err:dial tcp 69.171.237.16:80: i/o timeout,retrying... 2018/09/29 12:17:31 connect to , err:dial tcp [2404:6800:4008:803::2004]:80: i/o timeout,retrying... 2018/09/29 12:17:35 connect to , err:dial tcp [2404:6800:4008:803::2004]:80: i/o timeout 2018/09/29 12:17:35 connect to tls parent fail ``` 而且我在客户端访问 www.google.com 的时候在一级代理上抓包,发现它并没有发送请求到二级代理。
kerem closed this issue 2026-02-27 23:15:23 +03:00
Author
Owner

@snail007 commented on GitHub (Sep 29, 2018):

你就不能仔细看手册吗!
https://github.com/snail007/goproxy/blob/master/README_ZH.md#16http代理流量强制走上级http代理

<!-- gh-comment-id:425617878 --> @snail007 commented on GitHub (Sep 29, 2018): 你就不能仔细看手册吗! https://github.com/snail007/goproxy/blob/master/README_ZH.md#16http代理流量强制走上级http代理
Author
Owner

@maxadd commented on GitHub (Sep 29, 2018):

抱歉抱歉,看的时候确实没有留意这个。真是感谢大佬,提供了这么优秀的产品。

<!-- gh-comment-id:425618663 --> @maxadd commented on GitHub (Sep 29, 2018): 抱歉抱歉,看的时候确实没有留意这个。真是感谢大佬,提供了这么优秀的产品。
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#85
No description provided.