[GH-ISSUE #186] windows 无法将 ssh 转为 socks5 http #115

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

Originally created by @ztj1993 on GitHub (Nov 28, 2018).
Original GitHub issue: https://github.com/snail007/goproxy/issues/186

首先我在 Linux 上创建了一个账户,创建方式为:https://github.com/ztj1993/CodeFavorites/blob/master/Linux/ProxyUser.sh

然后,我希望通过 goproxy ssh to http 代理,但是无法实现,同时我使用 plink 转为 socks5 代理,然后通过 goproxy 转为 http 代理,亦无法实现。

plink 转为 socks5 代理后,本地可以通过 socks5 上网。

我原来的方案为 plink 转为 socks5,然后通过 privoxy 转为 http,这样的方案,本地可以使用 http 和 socks5 上网。

请问这种情况是何原因呢,是否为我创建用户的那个执行脚本所致。

Originally created by @ztj1993 on GitHub (Nov 28, 2018). Original GitHub issue: https://github.com/snail007/goproxy/issues/186 首先我在 Linux 上创建了一个账户,创建方式为:https://github.com/ztj1993/CodeFavorites/blob/master/Linux/ProxyUser.sh 然后,我希望通过 goproxy ssh to http 代理,但是无法实现,同时我使用 plink 转为 socks5 代理,然后通过 goproxy 转为 http 代理,亦无法实现。 plink 转为 socks5 代理后,本地可以通过 socks5 上网。 我原来的方案为 plink 转为 socks5,然后通过 privoxy 转为 http,这样的方案,本地可以使用 http 和 socks5 上网。 请问这种情况是何原因呢,是否为我创建用户的那个执行脚本所致。
kerem closed this issue 2026-02-27 23:15:31 +03:00
Author
Owner

@snail007 commented on GitHub (Nov 28, 2018):

看手册

<!-- gh-comment-id:442357167 --> @snail007 commented on GitHub (Nov 28, 2018): 看手册
Author
Owner

@ztj1993 commented on GitHub (Nov 28, 2018):

@snail007 这是我执行命令:

proxy.exe http --parent-type=ssh --parent="server:22" --ssh-user=user --ssh-password=pwd --local-type=tcp --local=":18080"

经过测试,这样是不行的,日志提升解码失败之类的,这是日志

2018/11/28 16:34:08 blocked file loaded , domains : 4833
2018/11/28 16:34:08 direct file loaded , domains : 456
2018/11/28 16:34:09 use ssh parent [{server}:22] [ ROUNDROBIN ]
2018/11/28 16:34:09 tcp http(s) proxy on [::]:18080
2018/11/28 16:34:18 decoder error , from 127.0.0.1:57734, ERR:http decoder data err:  ?mLB敓0?C'=屧?v?妌f\??? 匏^B绳
2018/11/28 16:34:18   锟?PP锟?P@U锟劫嶏拷锟斤拷锟経Q{锟斤拷\讯锟斤拷A锟絅OBR:锟酵咃拷锟斤拷锟紸(锟斤拷锟斤拷\锟斤拷cx锟斤拷锟斤拷l;d锟絵袘锟? "锟斤拷锟?锟?锟?锟?泰台锟?锟? 锟?锟?/ 5 
2018/11/28 16:34:18 use proxy : true, :80
2018/11/28 16:34:18   锟?R锟絒锟絆锟紾锟斤拷D锟?锟斤拷A锟斤拷锟?锟斤拷$锟絀U锟斤拷-锟?锟?x锟紾锟斤拷锟斤拷Y锟?3锟斤拷q5b锟斤拷A>9锟斤拷)锟絰锟?"
2018/11/28 16:34:18 use proxy : false, :80
2018/11/28 16:34:18 conn 127.0.0.1:57736 - 127.0.0.1:80 connected [:80]
2018/11/28 16:34:18   锟?锟組锟斤拷9@茤}锟斤拷锟斤拷K锟酵玙%锟?迒锟?:锟紹y2P
2018/11/28 16:34:18 use proxy : false, :80
2018/11/28 16:34:18 conn 127.0.0.1:57740 - 127.0.0.1:80 connected [:80]
2018/11/28 16:34:19 conn 127.0.0.1:57735 - 0.0.0.0:0 connected [:80]
2018/11/28 16:34:19 conn 127.0.0.1:57735 - 0.0.0.0:0 released [:80]
2018/11/28 16:34:34 CONNECT:www.baidu.com:443
2018/11/28 16:34:34 CONNECT:www.baidu.com:443
2018/11/28 16:34:34 CONNECT:ss1.bdstatic.com:443
2018/11/28 16:34:35 use proxy : false, www.baidu.com:443
2018/11/28 16:34:35 use proxy : false, www.baidu.com:443
<!-- gh-comment-id:442365734 --> @ztj1993 commented on GitHub (Nov 28, 2018): @snail007 这是我执行命令: ``` proxy.exe http --parent-type=ssh --parent="server:22" --ssh-user=user --ssh-password=pwd --local-type=tcp --local=":18080" ``` 经过测试,这样是不行的,日志提升解码失败之类的,这是日志 ``` 2018/11/28 16:34:08 blocked file loaded , domains : 4833 2018/11/28 16:34:08 direct file loaded , domains : 456 2018/11/28 16:34:09 use ssh parent [{server}:22] [ ROUNDROBIN ] 2018/11/28 16:34:09 tcp http(s) proxy on [::]:18080 2018/11/28 16:34:18 decoder error , from 127.0.0.1:57734, ERR:http decoder data err:  ?mLB敓0?C'=屧?v?妌f\??? 匏^B绳 2018/11/28 16:34:18   锟?PP锟?P@U锟劫嶏拷锟斤拷锟経Q{锟斤拷\讯锟斤拷A锟絅OBR:锟酵咃拷锟斤拷锟紸(锟斤拷锟斤拷\锟斤拷cx锟斤拷锟斤拷l;d锟絵袘锟? "锟斤拷锟?锟?锟?锟?泰台锟?锟? 锟?锟?/ 5 2018/11/28 16:34:18 use proxy : true, :80 2018/11/28 16:34:18   锟?R锟絒锟絆锟紾锟斤拷D锟?锟斤拷A锟斤拷锟?锟斤拷$锟絀U锟斤拷-锟?锟?x锟紾锟斤拷锟斤拷Y锟?3锟斤拷q5b锟斤拷A>9锟斤拷)锟絰锟?" 2018/11/28 16:34:18 use proxy : false, :80 2018/11/28 16:34:18 conn 127.0.0.1:57736 - 127.0.0.1:80 connected [:80] 2018/11/28 16:34:18   锟?锟組锟斤拷9@茤}锟斤拷锟斤拷K锟酵玙%锟?迒锟?:锟紹y2P 2018/11/28 16:34:18 use proxy : false, :80 2018/11/28 16:34:18 conn 127.0.0.1:57740 - 127.0.0.1:80 connected [:80] 2018/11/28 16:34:19 conn 127.0.0.1:57735 - 0.0.0.0:0 connected [:80] 2018/11/28 16:34:19 conn 127.0.0.1:57735 - 0.0.0.0:0 released [:80] 2018/11/28 16:34:34 CONNECT:www.baidu.com:443 2018/11/28 16:34:34 CONNECT:www.baidu.com:443 2018/11/28 16:34:34 CONNECT:ss1.bdstatic.com:443 2018/11/28 16:34:35 use proxy : false, www.baidu.com:443 2018/11/28 16:34:35 use proxy : false, www.baidu.com:443 ```
Author
Owner

@ztj1993 commented on GitHub (Nov 28, 2018):

@snail007 上面的日志可能是使用 https 代理导致的,浏览器 http 代理后,仍然没走代理,这是最新的日志

2018/11/28 17:13:57 blocked file loaded , domains : 4833
2018/11/28 17:13:57 direct file loaded , domains : 456
2018/11/28 17:13:58 use ssh parent [47.75.125.191:22] [ ROUNDROBIN ]
2018/11/28 17:13:58 tcp http(s) proxy on [::]:18080
2018/11/28 17:13:58 CONNECT:clients1.google.com:443
2018/11/28 17:13:58 use proxy : true, clients1.google.com:443
2018/11/28 17:13:58 conn 127.0.0.1:58949 - 0.0.0.0:0 connected [clients1.google.com:443]
2018/11/28 17:13:58 conn 127.0.0.1:58949 - 0.0.0.0:0 released [clients1.google.com:443]
2018/11/28 17:13:58 CONNECT:clients1.google.com:443
2018/11/28 17:13:58 use proxy : true, clients1.google.com:443
2018/11/28 17:13:58 conn 127.0.0.1:58950 - 0.0.0.0:0 connected [clients1.google.com:443]
2018/11/28 17:13:58 conn 127.0.0.1:58950 - 0.0.0.0:0 released [clients1.google.com:443]
2018/11/28 17:13:58 CONNECT:clients1.google.com:443
2018/11/28 17:13:58 use proxy : true, clients1.google.com:443
2018/11/28 17:13:58 conn 127.0.0.1:58951 - 0.0.0.0:0 connected [clients1.google.com:443]
2018/11/28 17:13:58 conn 127.0.0.1:58951 - 0.0.0.0:0 released [clients1.google.com:443]
2018/11/28 17:13:59 CONNECT:clients1.google.com:443
2018/11/28 17:13:59 use proxy : true, clients1.google.com:443
2018/11/28 17:13:59 conn 127.0.0.1:58952 - 0.0.0.0:0 connected [clients1.google.com:443]
2018/11/28 17:13:59 conn 127.0.0.1:58952 - 0.0.0.0:0 released [clients1.google.com:443]
2018/11/28 17:14:02 GET:http://ip.taobao.com/ipSearch.html
2018/11/28 17:14:02 use proxy : false, ip.taobao.com:80
2018/11/28 17:14:02 conn 127.0.0.1:58954 - 106.15.80.185:80 connected [ip.taobao.com:80]
2018/11/28 17:14:02 CONNECT:clients1.google.com:443
2018/11/28 17:14:02 use proxy : true, clients1.google.com:443

看来这次将 privoxy 转为 goproxy 的方案还是无法完成。

<!-- gh-comment-id:442375596 --> @ztj1993 commented on GitHub (Nov 28, 2018): @snail007 上面的日志可能是使用 https 代理导致的,浏览器 http 代理后,仍然没走代理,这是最新的日志 ``` 2018/11/28 17:13:57 blocked file loaded , domains : 4833 2018/11/28 17:13:57 direct file loaded , domains : 456 2018/11/28 17:13:58 use ssh parent [47.75.125.191:22] [ ROUNDROBIN ] 2018/11/28 17:13:58 tcp http(s) proxy on [::]:18080 2018/11/28 17:13:58 CONNECT:clients1.google.com:443 2018/11/28 17:13:58 use proxy : true, clients1.google.com:443 2018/11/28 17:13:58 conn 127.0.0.1:58949 - 0.0.0.0:0 connected [clients1.google.com:443] 2018/11/28 17:13:58 conn 127.0.0.1:58949 - 0.0.0.0:0 released [clients1.google.com:443] 2018/11/28 17:13:58 CONNECT:clients1.google.com:443 2018/11/28 17:13:58 use proxy : true, clients1.google.com:443 2018/11/28 17:13:58 conn 127.0.0.1:58950 - 0.0.0.0:0 connected [clients1.google.com:443] 2018/11/28 17:13:58 conn 127.0.0.1:58950 - 0.0.0.0:0 released [clients1.google.com:443] 2018/11/28 17:13:58 CONNECT:clients1.google.com:443 2018/11/28 17:13:58 use proxy : true, clients1.google.com:443 2018/11/28 17:13:58 conn 127.0.0.1:58951 - 0.0.0.0:0 connected [clients1.google.com:443] 2018/11/28 17:13:58 conn 127.0.0.1:58951 - 0.0.0.0:0 released [clients1.google.com:443] 2018/11/28 17:13:59 CONNECT:clients1.google.com:443 2018/11/28 17:13:59 use proxy : true, clients1.google.com:443 2018/11/28 17:13:59 conn 127.0.0.1:58952 - 0.0.0.0:0 connected [clients1.google.com:443] 2018/11/28 17:13:59 conn 127.0.0.1:58952 - 0.0.0.0:0 released [clients1.google.com:443] 2018/11/28 17:14:02 GET:http://ip.taobao.com/ipSearch.html 2018/11/28 17:14:02 use proxy : false, ip.taobao.com:80 2018/11/28 17:14:02 conn 127.0.0.1:58954 - 106.15.80.185:80 connected [ip.taobao.com:80] 2018/11/28 17:14:02 CONNECT:clients1.google.com:443 2018/11/28 17:14:02 use proxy : true, clients1.google.com:443 ``` 看来这次将 privoxy 转为 goproxy 的方案还是无法完成。
Author
Owner

@snail007 commented on GitHub (Nov 28, 2018):

看手册

<!-- gh-comment-id:442526835 --> @snail007 commented on GitHub (Nov 28, 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#115
No description provided.