我不明白为什么我的 ssh 创建的 socks 代理可以与 curl 一起使用,但却不能与 Chrome + Mac OS Yosemite 一起使用。
- 使用以下方式创建的 Socks 代理
ssh -D 8080 -p 5432 -i mypubkey.pem my-user@my_server_ip
- 经过测试
curl --socks5 localhost:8080 http://www.whatsmyip.net/ |grep "Address is"
- 与
curl --proxy socks://localhost:8080 http://www.whatsmyip.net/ |grep "Address is"
结果如下:
<h1 class="ip">Your <acronym title="Internet Protocol">IP</acronym> Address is <input type="text" value="my_server_ip" /></h1>
<h1 class="ip">Your <acronym title="Internet Protocol">IP</acronym>V6 Address is <input type="text" value="my_server_ip_v6" /></h1>
但是当我在系统级别配置 Yosemite 时,"Proxy SOCKS": localhost:8080
它根本无法与 Chrome/Firefox/Safari 配合使用。
添加-vv
更多详细信息我在使用 chrome 请求时看到以下堆栈
debug1: Connection to port 8080 forwarding to socks port 0 requested.
debug2: fd 22 setting TCP_NODELAY
debug1: channel 15: new [dynamic-tcpip]
debug2: channel 15: pre_dynamic: have 0
debug2: channel 15: pre_dynamic: have 3
debug2: channel 15: decode socks5
debug2: channel 15: socks5 auth done
debug2: channel 15: pre_dynamic: need more
debug2: channel 15: pre_dynamic: have 0
debug2: channel 15: pre_dynamic: have 20
debug2: channel 15: decode socks5
debug2: channel 15: socks5 post auth
debug2: channel 15: dynamic request: socks5 host www.google.fr port 443 command 1
debug1: Connection to port 8080 forwarding to socks port 0 requested.
debug2: fd 23 setting TCP_NODELAY
debug1: channel 16: new [dynamic-tcpip]
debug2: channel 16: pre_dynamic: have 0
debug2: channel 16: pre_dynamic: have 3
debug2: channel 16: decode socks5
debug2: channel 16: socks5 auth done
debug2: channel 16: pre_dynamic: need more
debug2: channel 16: pre_dynamic: have 0
debug2: channel 16: pre_dynamic: have 20
debug2: channel 16: decode socks5
debug2: channel 16: socks5 post auth
debug2: channel 16: dynamic request: socks5 host www.google.fr port 443 command 1
经过一些请求后,控制台被冻结,我看不到任何其他调试日志。
有什么办法可以解决这个问题吗?