Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gost 开启代理,报 bad version 错误 #1017

Open
vrcsds opened this issue Mar 3, 2024 · 1 comment
Open

gost 开启代理,报 bad version 错误 #1017

vrcsds opened this issue Mar 3, 2024 · 1 comment

Comments

@vrcsds
Copy link

vrcsds commented Mar 3, 2024

几台服务器,新装了 Ubuntu server 22.04.4,在其中一台上用 gost 启动代理,其它服务器连接时一直报 bad version,https、socks4、socks5 都是,只有代理类型是 http 时才正常

root@s01:~/my_dir/gost-linux-amd64-2.11.5# ./gost-linux-amd64 -D -L socks5://:8888
2024/03/03 09:41:31 route.go:695: socks5://:8888 on [::]:8888
2024/03/03 09:41:37 socks.go:855: [socks5] 192.168.10.2:53772 -> 192.168.10.1:8888 : bad version
2024/03/03 09:41:37 socks.go:855: [socks5] 192.168.10.2:53782 -> 192.168.10.1:8888 : bad version
2024/03/03 09:41:37 socks.go:855: [socks5] 192.168.10.2:53774 -> 192.168.10.1:8888 : bad version
2024/03/03 09:41:37 socks.go:855: [socks5] 192.168.10.2:53796 -> 192.168.10.1:8888 : bad version
2024/03/03 09:41:37 socks.go:855: [socks5] 192.168.10.2:53798 -> 192.168.10.1:8888 : bad version
2024/03/03 09:41:37 socks.go:855: [socks5] 192.168.10.2:53800 -> 192.168.10.1:8888 : bad version
2024/03/03 09:41:37 socks.go:855: [socks5] 192.168.10.2:53802 -> 192.168.10.1:8888 : bad version
2024/03/03 09:41:37 socks.go:855: [socks5] 192.168.10.2:53818 -> 192.168.10.1:8888 : bad version

之前在老系统 CentOS7 上用一切正常,哪位知道这是怎么回事?

@junxxx
Copy link

junxxx commented Mar 21, 2024

几台服务器,新装了 Ubuntu server 22.04.4,在其中一台上用 gost 启动代理,其它服务器连接时一直报 bad version,https、socks4、socks5 都是,只有代理类型是 http 时才正常

root@s01:~/my_dir/gost-linux-amd64-2.11.5# ./gost-linux-amd64 -D -L socks5://:8888 2024/03/03 09:41:31 route.go:695: socks5://:8888 on [::]:8888 2024/03/03 09:41:37 socks.go:855: [socks5] 192.168.10.2:53772 -> 192.168.10.1:8888 : bad version 2024/03/03 09:41:37 socks.go:855: [socks5] 192.168.10.2:53782 -> 192.168.10.1:8888 : bad version 2024/03/03 09:41:37 socks.go:855: [socks5] 192.168.10.2:53774 -> 192.168.10.1:8888 : bad version 2024/03/03 09:41:37 socks.go:855: [socks5] 192.168.10.2:53796 -> 192.168.10.1:8888 : bad version 2024/03/03 09:41:37 socks.go:855: [socks5] 192.168.10.2:53798 -> 192.168.10.1:8888 : bad version 2024/03/03 09:41:37 socks.go:855: [socks5] 192.168.10.2:53800 -> 192.168.10.1:8888 : bad version 2024/03/03 09:41:37 socks.go:855: [socks5] 192.168.10.2:53802 -> 192.168.10.1:8888 : bad version 2024/03/03 09:41:37 socks.go:855: [socks5] 192.168.10.2:53818 -> 192.168.10.1:8888 : bad version

之前在老系统 CentOS7 上用一切正常,哪位知道这是怎么回事?

根据报错定位到源代码socks.go 855行,其调用 https://github.com/go-gost/gosocks5/blob/master/socks5.go#L445 。根据代码来看,报错的意思是说读取Request的第一个Byte不是socks5的版本。
你可以自己把源代码下载,然后打断点调试输出b[0]的值,看它读到的是什么值。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants