[GH-ISSUE #400] 无法使用https的上级代理 #307

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

Originally created by @liudonghua123 on GitHub (Sep 17, 2020).
Original GitHub issue: https://github.com/snail007/goproxy/issues/400

我测试在浏览器插件中设置https的代理(假设代理服务器域名是 a.b.c, 端口是 443)是正常的,我想在搭建一个本地的http代理,其上级设置为之前可以正常工作的https代理,我使用 proxy http -P a.b.c:443 -T tls -t tcp,提示需要proxy.crt,我把 https://a.b.c 的证书下载下来另存为 proxy.crt,再次执行的时候又提示需要 proxy.key,因为这个代理服务器不是我自己的,所有没办法获取到key,另外在浏览器里面以及命令行上通过http_proxy/https_proxy配置https代理的时候其实是不需要crtkey

Expected Behavior

支持简单的https代理,可以在本地执行例如 proxy http -P a.b.c:443 -T https -t tcp

Current Behavior

需要提供无法提供的crt/key

Context (Environment)

  1. proxy version is : v10.0
  2. full command is : proxy http -P a.b.c:443 -T tls -t tcp
  3. system is : win 10
  4. full log is:
proxy free version 10.0  by snail , email : arraykeys@gmail.com
2020/09/17 15:28:54 err : run service [http:http] fail, ERR:http servcie fail, ERR: err : file not found , proxy.crt

proxy free version 10.0  by snail , email : arraykeys@gmail.com
2020/09/17 15:31:57 err : run service [http:http] fail, ERR:http servcie fail, ERR: err : file not found , proxy.key

Detailed Description

Possible Implementation

Originally created by @liudonghua123 on GitHub (Sep 17, 2020). Original GitHub issue: https://github.com/snail007/goproxy/issues/400 <!--- Provide a general summary of the issue in the Title above --> 我测试在浏览器插件中设置https的代理(假设代理服务器域名是 a.b.c, 端口是 443)是正常的,我想在搭建一个本地的http代理,其上级设置为之前可以正常工作的https代理,我使用 `proxy http -P a.b.c:443 -T tls -t tcp`,提示需要`proxy.crt`,我把 `https://a.b.c` 的证书下载下来另存为 `proxy.crt`,再次执行的时候又提示需要 `proxy.key`,因为这个代理服务器不是我自己的,所有没办法获取到key,另外在浏览器里面以及命令行上通过`http_proxy/https_proxy`配置https代理的时候其实是不需要`crt`、`key` ## Expected Behavior <!--- Tell us what should happen --> 支持简单的https代理,可以在本地执行例如 `proxy http -P a.b.c:443 -T https -t tcp` ## Current Behavior 需要提供无法提供的crt/key ## Context (Environment) <!--- How has this issue affected you? What are you trying to accomplish? --> <!--- Providing context helps us come up with a solution that is most useful in the real world --> 1. proxy version is : v10.0 1. full command is : `proxy http -P a.b.c:443 -T tls -t tcp` 1. system is : win 10 1. full log is: ``` proxy free version 10.0 by snail , email : arraykeys@gmail.com 2020/09/17 15:28:54 err : run service [http:http] fail, ERR:http servcie fail, ERR: err : file not found , proxy.crt proxy free version 10.0 by snail , email : arraykeys@gmail.com 2020/09/17 15:31:57 err : run service [http:http] fail, ERR:http servcie fail, ERR: err : file not found , proxy.key ``` <!--- Provide a general summary of the issue in the Title above --> ## Detailed Description <!--- Provide a detailed description of the change or addition you are proposing --> ## Possible Implementation <!--- Not obligatory, but suggest an idea for implementing addition or change -->
kerem closed this issue 2026-02-27 23:16:26 +03:00
Author
Owner
<!-- gh-comment-id:694127433 --> @snail007 commented on GitHub (Sep 17, 2020): 使用不当,参考: https://snail.gitee.io/proxy/page/faq/goproxy%E5%B8%B8%E8%A7%81%E9%97%AE%E9%A2%98%E8%A7%A3%E7%AD%94/ https://www.bilibili.com/video/BV1aK411L7nL/
Author
Owner

@liudonghua123 commented on GitHub (Sep 17, 2020):

使用不当,参考:
https://snail.gitee.io/proxy/page/faq/goproxy%E5%B8%B8%E8%A7%81%E9%97%AE%E9%A2%98%E8%A7%A3%E7%AD%94/

https://www.bilibili.com/video/BV1aK411L7nL/

视频里面介绍的是自己搭建的https代理服务器,我需要实现的是已有一个https代理(是一个开放公共的,switchyomega里面可以直接配置使用),但是我想在localhost本地启动一个http代理,配置其上级是已有的https代理,之所以这么做是因为一个奇怪的问题,浏览器里面使用这个代理实可以的,在系统应用程序里面使用需要添加一些参数(例如curl的 --proxy-insecure)才行,有些客户端不支持这些设置,所以我才想添加一层本地的http代理,上一级使用已有一个https代理。

请问一下,那这种情况,命令应该如何写?谢谢!

<!-- gh-comment-id:694219859 --> @liudonghua123 commented on GitHub (Sep 17, 2020): > 使用不当,参考: > https://snail.gitee.io/proxy/page/faq/goproxy%E5%B8%B8%E8%A7%81%E9%97%AE%E9%A2%98%E8%A7%A3%E7%AD%94/ > > https://www.bilibili.com/video/BV1aK411L7nL/ 视频里面介绍的是自己搭建的https代理服务器,我需要实现的是已有一个https代理(是一个开放公共的,switchyomega里面可以直接配置使用),但是我想在localhost本地启动一个http代理,配置其上级是已有的https代理,之所以这么做是因为一个奇怪的问题,浏览器里面使用这个代理实可以的,在系统应用程序里面使用需要添加一些参数(例如curl的 --proxy-insecure)才行,有些客户端不支持这些设置,所以我才想添加一层本地的http代理,上一级使用已有一个https代理。 请问一下,那这种情况,命令应该如何写?谢谢!
Author
Owner

@snail007 commented on GitHub (Sep 17, 2020):

看手册sps,上级-P格式支持https。

<!-- gh-comment-id:694239669 --> @snail007 commented on GitHub (Sep 17, 2020): 看手册sps,上级-P格式支持https。
Author
Owner

@liudonghua123 commented on GitHub (Sep 18, 2020):

@snail007 你好,我看文档里面sps这部分的介绍( https://snail.gitee.io/proxy/manual/zh/#/?id=_62-https%e8%bd%achttpssocks5ss ),因为已知的是一个https代理,没有证书、秘钥,也不需要用户名密码,想本地部署一个http代理,上级连接这个https代理,我试了 proxy sps -S http -T tcp -P usa.cn-cloudflare.com:443 -t tcp,但这时候,连接不了,大致错误输出是

2020/09/18 09:22:52 CONNECT:www.google.com:443
2020/09/18 09:22:52 use parent : false, www.google.com:443
2020/09/18 09:22:52 ip 127.0.0.1 rate, current: 1/s, max: 20/s
2020/09/18 09:22:52 CONNECT:lh3.googleusercontent.com:443
2020/09/18 09:22:52 CONNECT:www.gstatic.com:443
2020/09/18 09:22:52 use parent : true, lh3.googleusercontent.com:443
2020/09/18 09:22:52 use parent : true, www.gstatic.com:443
2020/09/18 09:22:52 ip 127.0.0.1 rate, current: 3/s, max: 20/s
2020/09/18 09:22:52 ip 127.0.0.1 rate, current: 2/s, max: 20/s
2020/09/18 09:22:52 conn 127.0.0.1:52968 - 185.152.67.14:443 connected [www.gstatic.com:443]
2020/09/18 09:22:52 conn 127.0.0.1:52968 - 185.152.67.14:443 released [www.gstatic.com:443]
2020/09/18 09:22:52 conn 127.0.0.1:52967 - 185.152.67.14:443 connected [lh3.googleusercontent.com:443]
2020/09/18 09:22:52 conn 127.0.0.1:52967 - 185.152.67.14:443 released [lh3.googleusercontent.com:443]
2020/09/18 09:22:57 connect to  , err:dial tcp 127.0.0.1:443: connectex: No connection could be made because the target machine actively refused it.,retrying...
2020/09/18 09:23:02 conn 127.0.0.1:52928 - 39.130.136.32:443 released [ss1.bdstatic.com:443]
2020/09/18 09:23:04 connect to  , err:dial tcp 127.0.0.1:443: connectex: No connection could be made because the target machine actively refused it.
2020/09/18 09:23:04 CONNECT:api.github.com:443
2020/09/18 09:23:04 use parent : true, api.github.com:443
2020/09/18 09:23:04 ip 127.0.0.1 rate, current: 1/s, max: 20/s
2020/09/18 09:23:04 conn 127.0.0.1:52995 - 185.152.67.14:443 connected [api.github.com:443]
2020/09/18 09:23:04 conn 127.0.0.1:52995 - 185.152.67.14:443 released [api.github.com:443]
2020/09/18 09:23:09 CONNECT:www.google.com:443
2020/09/18 09:23:09 use parent : false, www.google.com:443
2020/09/18 09:23:09 CONNECT:lh3.googleusercontent.com:443
2020/09/18 09:23:09 use parent : false, lh3.googleusercontent.com:443
2020/09/18 09:23:09 ip 127.0.0.1 rate, current: 1/s, max: 20/s
2020/09/18 09:23:09 CONNECT:www.gstatic.com:443
2020/09/18 09:23:09 use parent : false, www.gstatic.com:443
2020/09/18 09:23:09 ip 127.0.0.1 rate, current: 3/s, max: 20/s
2020/09/18 09:23:09 ip 127.0.0.1 rate, current: 2/s, max: 20/s
2020/09/18 09:23:09 conn 127.0.0.1:53007 - 203.208.40.34:443 connected [www.gstatic.com:443]
2020/09/18 09:23:13 conn 127.0.0.1:52937 - 112.34.111.63:443 released [passport.baidu.com:443]
2020/09/18 09:23:14 connect to  , err:dial tcp 216.58.200.225:443: i/o timeout,retrying...
2020/09/18 09:23:14 connect to  , err:dial tcp 127.0.0.1:443: connectex: No connection could be made because the target machine actively refused it.,retrying...

我也试了 proxy http -P usa.cn-cloudflare.com:443 -T tcp -t tcp

2020/09/18 09:24:05 CONNECT:www.google.com:443
2020/09/18 09:24:05 use parent : false, www.google.com:443
2020/09/18 09:24:05 ip 127.0.0.1 rate, current: 1/s, max: 20/s
2020/09/18 09:24:05 CONNECT:lh3.googleusercontent.com:443
2020/09/18 09:24:05 use parent : false, lh3.googleusercontent.com:443
2020/09/18 09:24:05 CONNECT:www.gstatic.com:443
2020/09/18 09:24:05 use parent : false, www.gstatic.com:443
2020/09/18 09:24:05 ip 127.0.0.1 rate, current: 3/s, max: 20/s
2020/09/18 09:24:05 ip 127.0.0.1 rate, current: 2/s, max: 20/s
2020/09/18 09:24:05 conn 127.0.0.1:53116 - 203.208.40.34:443 connected [www.gstatic.com:443]
2020/09/18 09:24:10 connect to  , err:dial tcp 216.58.200.225:443: i/o timeout,retrying...
2020/09/18 09:24:10 connect to  , err:dial tcp 127.0.0.1:443: connectex: No connection could be made because the target machine actively refused it.,retrying...
2020/09/18 09:24:17 connect to  , err:dial tcp 216.58.200.225:443: i/o timeout
2020/09/18 09:24:17 connect to  , err:dial tcp 127.0.0.1:443: connectex: No connection could be made because the target machine actively refused it.
<!-- gh-comment-id:694594417 --> @liudonghua123 commented on GitHub (Sep 18, 2020): @snail007 你好,我看文档里面sps这部分的介绍( https://snail.gitee.io/proxy/manual/zh/#/?id=_62-https%e8%bd%achttpssocks5ss ),因为已知的是一个https代理,没有证书、秘钥,也不需要用户名密码,想本地部署一个http代理,上级连接这个https代理,我试了 `proxy sps -S http -T tcp -P usa.cn-cloudflare.com:443 -t tcp`,但这时候,连接不了,大致错误输出是 ``` 2020/09/18 09:22:52 CONNECT:www.google.com:443 2020/09/18 09:22:52 use parent : false, www.google.com:443 2020/09/18 09:22:52 ip 127.0.0.1 rate, current: 1/s, max: 20/s 2020/09/18 09:22:52 CONNECT:lh3.googleusercontent.com:443 2020/09/18 09:22:52 CONNECT:www.gstatic.com:443 2020/09/18 09:22:52 use parent : true, lh3.googleusercontent.com:443 2020/09/18 09:22:52 use parent : true, www.gstatic.com:443 2020/09/18 09:22:52 ip 127.0.0.1 rate, current: 3/s, max: 20/s 2020/09/18 09:22:52 ip 127.0.0.1 rate, current: 2/s, max: 20/s 2020/09/18 09:22:52 conn 127.0.0.1:52968 - 185.152.67.14:443 connected [www.gstatic.com:443] 2020/09/18 09:22:52 conn 127.0.0.1:52968 - 185.152.67.14:443 released [www.gstatic.com:443] 2020/09/18 09:22:52 conn 127.0.0.1:52967 - 185.152.67.14:443 connected [lh3.googleusercontent.com:443] 2020/09/18 09:22:52 conn 127.0.0.1:52967 - 185.152.67.14:443 released [lh3.googleusercontent.com:443] 2020/09/18 09:22:57 connect to , err:dial tcp 127.0.0.1:443: connectex: No connection could be made because the target machine actively refused it.,retrying... 2020/09/18 09:23:02 conn 127.0.0.1:52928 - 39.130.136.32:443 released [ss1.bdstatic.com:443] 2020/09/18 09:23:04 connect to , err:dial tcp 127.0.0.1:443: connectex: No connection could be made because the target machine actively refused it. 2020/09/18 09:23:04 CONNECT:api.github.com:443 2020/09/18 09:23:04 use parent : true, api.github.com:443 2020/09/18 09:23:04 ip 127.0.0.1 rate, current: 1/s, max: 20/s 2020/09/18 09:23:04 conn 127.0.0.1:52995 - 185.152.67.14:443 connected [api.github.com:443] 2020/09/18 09:23:04 conn 127.0.0.1:52995 - 185.152.67.14:443 released [api.github.com:443] 2020/09/18 09:23:09 CONNECT:www.google.com:443 2020/09/18 09:23:09 use parent : false, www.google.com:443 2020/09/18 09:23:09 CONNECT:lh3.googleusercontent.com:443 2020/09/18 09:23:09 use parent : false, lh3.googleusercontent.com:443 2020/09/18 09:23:09 ip 127.0.0.1 rate, current: 1/s, max: 20/s 2020/09/18 09:23:09 CONNECT:www.gstatic.com:443 2020/09/18 09:23:09 use parent : false, www.gstatic.com:443 2020/09/18 09:23:09 ip 127.0.0.1 rate, current: 3/s, max: 20/s 2020/09/18 09:23:09 ip 127.0.0.1 rate, current: 2/s, max: 20/s 2020/09/18 09:23:09 conn 127.0.0.1:53007 - 203.208.40.34:443 connected [www.gstatic.com:443] 2020/09/18 09:23:13 conn 127.0.0.1:52937 - 112.34.111.63:443 released [passport.baidu.com:443] 2020/09/18 09:23:14 connect to , err:dial tcp 216.58.200.225:443: i/o timeout,retrying... 2020/09/18 09:23:14 connect to , err:dial tcp 127.0.0.1:443: connectex: No connection could be made because the target machine actively refused it.,retrying... ``` 我也试了 `proxy http -P usa.cn-cloudflare.com:443 -T tcp -t tcp` ``` 2020/09/18 09:24:05 CONNECT:www.google.com:443 2020/09/18 09:24:05 use parent : false, www.google.com:443 2020/09/18 09:24:05 ip 127.0.0.1 rate, current: 1/s, max: 20/s 2020/09/18 09:24:05 CONNECT:lh3.googleusercontent.com:443 2020/09/18 09:24:05 use parent : false, lh3.googleusercontent.com:443 2020/09/18 09:24:05 CONNECT:www.gstatic.com:443 2020/09/18 09:24:05 use parent : false, www.gstatic.com:443 2020/09/18 09:24:05 ip 127.0.0.1 rate, current: 3/s, max: 20/s 2020/09/18 09:24:05 ip 127.0.0.1 rate, current: 2/s, max: 20/s 2020/09/18 09:24:05 conn 127.0.0.1:53116 - 203.208.40.34:443 connected [www.gstatic.com:443] 2020/09/18 09:24:10 connect to , err:dial tcp 216.58.200.225:443: i/o timeout,retrying... 2020/09/18 09:24:10 connect to , err:dial tcp 127.0.0.1:443: connectex: No connection could be made because the target machine actively refused it.,retrying... 2020/09/18 09:24:17 connect to , err:dial tcp 216.58.200.225:443: i/o timeout 2020/09/18 09:24:17 connect to , err:dial tcp 127.0.0.1:443: connectex: No connection could be made because the target machine actively refused it. ```
Author
Owner

@liudonghua123 commented on GitHub (Sep 23, 2020):

@snail007 你好,我还是测试了几个不同的参数,还是连接不了,浏览器里面或者curl直接使用export http_proxy/https_proxy=https://usa.cn-cloudflare.com:443 是可以代理的,想使用goproxy封装一个http代理就始终不行,不知道为什么,是在看不出是哪出问题,还请不吝赐教

<!-- gh-comment-id:697527694 --> @liudonghua123 commented on GitHub (Sep 23, 2020): @snail007 你好,我还是测试了几个不同的参数,还是连接不了,浏览器里面或者curl直接使用export http_proxy/https_proxy=https://usa.cn-cloudflare.com:443 是可以代理的,想使用goproxy封装一个http代理就始终不行,不知道为什么,是在看不出是哪出问题,还请不吝赐教
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#307
No description provided.