mritd / dockerfile

some personally made dockerfile
https://hub.docker.com/u/mritd
MIT License
2.07k stars 647 forks source link

服务器运行Server后,ubuntu 18用docker运行Client端,似乎没作用,但是Windows下使用正常 #81

Closed hegphegp closed 5 years ago

hegphegp commented 5 years ago
海外服务器运行下面命令
docker run -dt --restart always --name new-ssserver -p 6455:6455 -p 6458:6458/udp mritd/shadowsocks -m "ss-server" -s "-s 0.0.0.0 -p 6455 -m chacha20-ietf-poly1305 -k test123 --fast-open" -x -e "kcpserver" -k "-t 127.0.0.1:6455 -l :6458 -mode fast2"
服务器端的日志
starting shadowsocks...
starting kcptun...
 2019-06-15 18:05:14 INFO: using tcp fast open
 2019-06-15 18:05:14 INFO: initializing ciphers... chacha20-ietf-poly1305
 2019-06-15 18:05:14 INFO: tcp server listening at 0.0.0.0:6455
2019/06/15 18:05:14 version: 20190424
2019/06/15 18:05:14 initiating key derivation
2019/06/15 18:05:14 listening on: [::]:6458
2019/06/15 18:05:14 target: 127.0.0.1:6455
2019/06/15 18:05:14 encryption: aes
2019/06/15 18:05:14 nodelay parameters: 1 20 2 1
2019/06/15 18:05:14 sndwnd: 1024 rcvwnd: 1024
2019/06/15 18:05:14 compression: true
2019/06/15 18:05:14 mtu: 1350
2019/06/15 18:05:14 datashard: 10 parityshard: 3
2019/06/15 18:05:14 acknodelay: false
2019/06/15 18:05:14 dscp: 0
2019/06/15 18:05:14 sockbuf: 4194304
2019/06/15 18:05:14 smuxbuf: 4194304
2019/06/15 18:05:14 keepalive: 10
2019/06/15 18:05:14 snmplog: 
2019/06/15 18:05:14 snmpperiod: 60
2019/06/15 18:05:14 pprof: false
2019/06/15 18:05:14 quiet: false
2019/06/15 18:07:34 remote address: xxxxxxxxx:9009
本地是Ubuntu18,用docker运行客户端
docker run -dt --restart always --name ssclient -p 1080:1080 mritd/shadowsocks -m "ss-local" -s "-s 127.0.0.1 -p 6458 -b 0.0.0.0 -l 1080 -m chacha20-ietf-poly1305 -k test123 --fast-open" -x -e "kcpclient" -k "-r 服务器的IP地址:6458 -l :6458 -mode fast2"
本地client的日志
starting kcptun...
starting shadowsocks...
 2019-06-15 18:07:24 INFO: using tcp fast open
 2019-06-15 18:07:24 INFO: initializing ciphers... chacha20-ietf-poly1305
 2019-06-15 18:07:24 INFO: listening at 0.0.0.0:1080
2019/06/15 18:07:24 version: 20190424
2019/06/15 18:07:24 initiating key derivation
2019/06/15 18:07:24 listening on: [::]:6458
2019/06/15 18:07:24 encryption: aes
2019/06/15 18:07:24 nodelay parameters: 1 20 2 1
2019/06/15 18:07:24 remote address: 45.32.216.170:6458
2019/06/15 18:07:24 sndwnd: 128 rcvwnd: 512
2019/06/15 18:07:24 compression: true
2019/06/15 18:07:24 mtu: 1350
2019/06/15 18:07:24 datashard: 10 parityshard: 3
2019/06/15 18:07:24 acknodelay: false
2019/06/15 18:07:24 dscp: 0
2019/06/15 18:07:24 sockbuf: 4194304
2019/06/15 18:07:24 smuxbuf: 4194304
2019/06/15 18:07:24 keepalive: 10
2019/06/15 18:07:24 conn: 1
2019/06/15 18:07:24 autoexpire: 0
2019/06/15 18:07:24 scavengettl: 600
2019/06/15 18:07:24 snmplog: 
2019/06/15 18:07:24 snmpperiod: 60
2019/06/15 18:07:24 quiet: false
2019/06/15 18:07:24 connection: 0.0.0.0:33632 -> xxxxxx:6458

一开始,我以为ss服务器有问题,我找了一台Windows电脑,使用Windows的shadowsocks客户端和kcpclient的客户端测试,发现可以正常访问海外,并且网速可以维持在 1MB/s。然后,我重新找了好几台vultr服务器测试,发现Windows可以正常使用,Ubuntu18用docker运行client不起效果,我又找了别人的Ubuntu18电脑用docker运行client测试,发现不行。我猜测,应该是Ubuntu18运行client,但是请求没有走代理

mritd commented 5 years ago

你在 ubuntu18 下如何测试的代理是否成功?

hegphegp commented 5 years ago

你在 ubuntu18 下如何测试的代理是否成功?

01) 在Ubuntu18运行完docker的client命令后,我直接用浏览器访问 http://www.google.com,没响应

02) 用curl走代理测试,抛了 curl: (56) Proxy CONNECT aborted,不知道是不是Ubuntu本身的问题,因为Windows没问题

curl -x localhost:1080 http://www.google.com
# curl: (56) Proxy CONNECT aborted
curl --proxy localhost:1080 http://www.google.com
# curl: (56) Proxy CONNECT aborted

image

mritd commented 5 years ago

测试了一下,使用同样的命令暂时没有发现任何问题,我怀疑可能是你 ubuntu18 iptables 有什么问题导致的什么问题;同时我升级了最新的 kcptun,已经推送到 docker hub

mritd commented 5 years ago

还有 作为 client 运行后不会自动设置系统代理,仍需要你在浏览器端进行设置,比如 Chrome 使用 proxy-switchyomega 插件

hegphegp commented 5 years ago

好的,谢谢

ez2cn commented 4 years ago

有意思,我在ubuntu 20跟你碰到的问题一样,只能跑到win上用了