ginuerzh / gost

GO Simple Tunnel - a simple tunnel written in golang
MIT License
15.48k stars 2.43k forks source link

请问该如何结合sni代理与socks5服务器 #876

Closed wnark closed 1 year ago

wnark commented 1 year ago

我在国内idc机房部署了一个socks5服务器 ip:113.5.86.4 端口:12345 账号:1qaz2wsx 密码:1qaz2wsx3edc4rfv 使用sstap验证可以使用 image 但当我使用这个配置,用来部署sni代理服务,连接到socks5服务器所在idc机房,以可以通过gost所在服务器直接访问时

/usr/bin/gost -L http://:80 -L sni://:443 -F=forward+socks5://1qaz2wsx:1qaz2wsx3edc4rfv@113.5.86.4:12345

却发现会有不断刷新:

2022/09/14 22:13:49 http.go:309: [http] 192.168.11.14:60353 <-> wiki.dev.xxx.com:80
2022/09/14 22:13:49 http.go:311: [http] 192.168.11.14:60353 >-< wiki.dev.xxx.com:80
2022/09/14 22:13:49 http.go:161: [http] 192.168.11.14:60354 -> http://:80 -> wiki.dev.xxx.com:80
2022/09/14 22:13:49 http.go:180: [http][transparent] wiki.dev.xxx.com:80
2022/09/14 22:13:49 http.go:256: [route] 192.168.11.14:60354 -> http://:80 -> 1@forward+socks5://113.5.86.4:12345 -> wiki.dev.zettakit.com:80

然后sni代理后的网站并不能正常工作

wnark commented 1 year ago

解决了。 如下所示,需要手动指定使用hosts文件,否则,gost会从socks5获取dns解析。

/usr/bin/gost -L http://:80?hosts=/etc/hosts -L sni://:443?hosts=/etc/hosts  -F=socks5://yonghuming:mima@123.123.123.123:4111