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

【bug】http_proxy 允许所有 IP 访问 #97

Open
RexWzh opened this issue Feb 24, 2024 · 2 comments
Open

【bug】http_proxy 允许所有 IP 访问 #97

RexWzh opened this issue Feb 24, 2024 · 2 comments

Comments

@RexWzh
Copy link

RexWzh commented Feb 24, 2024

复现过程:

# 添加节点,并设置序号为 0
shadowsocksr-cli --add-ssr ssr://xxxx
# 测试节点
shadowsocksr-cli --test-again 0
# 允许所有 IP 访问
shadowsocksr-cli --setting-address 0.0.0.0
# 用默认端口启动 socks5
shadowsocksr-cli -s 0
# 启动 http
shadowsocksr-cli --http-proxy start --http-proxy-port 7890

经过上边配置:

  1. socks5://localhost:1080http://localhost:7890 能使用代理
  2. socks5://局域网IP:1080 能使用
  3. http://局域网ip:7890 不能使用
export all_proxy=http://172.23.148.35:7890
❯ ipinfo
curl: (7) Failed to connect to 172.23.148.35 port 7890: Connection refused
❯ lsof -i:7890
COMMAND     PID    USER   FD   TYPE     DEVICE SIZE/OFF NODE NAME
shadowsoc 13311 zhihong    6u  IPv4 1216689873      0t0  TCP localhost:7890 (LISTEN)
@RexWzh
Copy link
Author

RexWzh commented Feb 24, 2024

lsof 这里能看出区别

❯ lsof -i:7890
COMMAND     PID    USER   FD   TYPE     DEVICE SIZE/OFF NODE NAME
shadowsoc 13311 zhihong    6u  IPv4 1216689873      0t0  TCP localhost:7890 (LISTEN)
❯ lsof -i:1080
COMMAND     PID    USER   FD   TYPE     DEVICE SIZE/OFF NODE NAME
shadowsoc 13301 zhihong    7u  IPv4 1216669598      0t0  TCP *:socks (LISTEN)
shadowsoc 13301 zhihong    8u  IPv4 1216669599      0t0  UDP *:socks 

@BrightXiaoHan
Copy link

你好,这个功能是我加的,当时没有考虑到这种情况,可以在代码里更改
https://github.com/BrightXiaoHan/ssr-command-client/blob/1a66f164e58eaabb8d8b64618d3b0b369cb286bf/shadowsocksr_cli/proxy_socks2http.py#L113
host 从localhost改成"0.0.0.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