Closed Jason0214 closed 1 month ago
Your test cases were all about HTTP proxy protocol, so there is nothing about redir
.
however,
http_proxy=http://192.168.1.1:1080 curl www.google.com -v
stuck at
Of course it would stuck, your HTTP local server was listening on 127.0.0.1:1087
, not 192.168.1.1:1080
.
On the other hand, if you want to use redir
in your environment, you should set iptables rules to redirect TCP and UDP packets to 192.168.1.1:1080
. Please search more about the redir
mode about what it was actually doing and how to make it work.
iptables rules example could be found at https://github.com/shadowsocks/shadowsocks-rust/blob/master/configs/iptables_mixed.sh . These rules for TCP with redirect
mode and UDP with tproxy
mode.
Environment
OpenWRT
23.05.4
kernel5.15.162
shadowsocks-rust 1.20.3Client Config:
Server config is all default with
"mode": "tcp_and_udp"
.http_proxy=http://127.0.0.1:1087 curl www.google.com -v
works, however,http_proxy=http://192.168.1.1:1080 curl www.google.com -v
stuck atthen timeout with
curl: (52) Empty reply from server
.Client log
Server log
Seems nothing special..
TCP dump from the server for the HTTP request:
It seem the TCP handshake is established?
I start losing ideas of how to debugging further. Any idea on how to proceed? I had a slight concern if the firewall on OpenWRT messed up with the redir, but not sure how to check.
Thanks in advance for any suggestions/ideas.