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] IN-PORT规则在http代理协议下没有生效 #1162

Closed
5 of 6 tasks
ykelvis opened this issue Apr 4, 2024 · 6 comments
Closed
5 of 6 tasks

[Bug] IN-PORT规则在http代理协议下没有生效 #1162

ykelvis opened this issue Apr 4, 2024 · 6 comments
Labels
bug Something isn't working

Comments

@ykelvis
Copy link

ykelvis commented Apr 4, 2024

Verify steps

  • 确保你使用的是本仓库最新的的 mihomo 或 mihomo Alpha 版本 Ensure you are using the latest version of Mihomo or Mihomo Alpha from this repository.
  • 如果你可以自己 debug 并解决的话,提交 PR 吧 Is this something you can debug and fix? Send a pull request! Bug fixes and documentation fixes are welcome.
  • 我已经在 Issue Tracker 中找过我要提出的问题 I have searched on the issue tracker for a related issue.
  • 我已经使用 Alpha 分支版本测试过,问题依旧存在 I have tested using the dev branch, and the issue still exists.
  • 我已经仔细看过 Documentation 并无法自行解决问题 I have read the documentation and was unable to solve the issue.
  • 这是 Mihomo 核心的问题,并非我所使用的 Mihomo 衍生版本(如 OpenMihomo、KoolMihomo 等)的特定问题 This is an issue of the Mihomo core per se, not to the derivatives of Mihomo, like OpenMihomo or KoolMihomo.

Mihomo version

Mihomo Meta alpha-b56e73a linux amd64 with go1.22.1 Wed Apr 3 15:41:59 UTC 2024 Use tags: with_gvisor

What OS are you seeing the problem on?

Linux

Mihomo config

listeners:
  - { name: "mixed-in-8001", type: "mixed", port: 8001, listen: 0.0.0.0, udp: true }
  - { name: "http-in-8002", type: "http", port: 8002, listen: 0.0.0.0, udp: true }
  - { name: "socks5-in-8003", type: "socks", port: 8003, listen: 0.0.0.0, udp: true }

profile:
  store-selected: true

proxies:
  - { name: "proxy1", type: socks5, server: "192.168.0.11", port: 8000 , udp: true}
  - { name: "proxy2", type: socks5, server: "192.168.0.11", port: 8001 , udp: true}
rules:
  - IN-port,8001,proxy1
  - IN-port,8002,proxy1
  - IN-port,8003,proxy1
  - MATCH,proxy2

Mihomo log

INFO[2024-04-04T20:46:23.633883465+08:00] Start initial configuration in progress      
INFO[2024-04-04T20:46:23.63430347+08:00] Geodata Loader mode: memconservative         
INFO[2024-04-04T20:46:23.634331989+08:00] Geosite Matcher implementation: succinct     
INFO[2024-04-04T20:46:23.634916212+08:00] Initial configuration complete, total time: 0ms 
INFO[2024-04-04T20:46:23.676029689+08:00] Sniffer is closed                            
INFO[2024-04-04T20:46:23.676305658+08:00] Mixed(http+socks)[mixed-in-8001] proxy listening at: [::]:8001 
INFO[2024-04-04T20:46:23.67634824+08:00] HTTP[http-in-8002] proxy listening at: [::]:8002 
INFO[2024-04-04T20:46:23.676394027+08:00] SOCKS[socks5-in-8003] proxy listening at: [::]:8003 
INFO[2024-04-04T20:46:23.677619122+08:00] Start initial Compatible provider default    
INFO[2024-04-04T20:46:24.958437691+08:00] [TCP] 127.0.0.1:33792 --> checkip.amazonaws.com:80 match Match using proxy2 
INFO[2024-04-04T20:46:25.438242666+08:00] [TCP] 127.0.0.1:33796 --> 44.206.10.32:80 match InPort(8001) using proxy1 
INFO[2024-04-04T20:46:25.89111025+08:00] [TCP] 127.0.0.1:34818 --> checkip.amazonaws.com:80 match Match using proxy2 
INFO[2024-04-04T20:46:26.350028672+08:00] [TCP] 127.0.0.1:53924 --> 44.206.10.32:80 match InPort(8003) using proxy1

Description

根据文档描述,IN-PORT匹配入站(listener)端口来分流 https://wiki.metacubex.one/config/rules/

预期效果: 8001(mixed), 8002(http), 8003(socks5), 三个代理按入站端口分流

实际效果:
使用http代理没有被IN-PORT规则进行分流,socks5是可以的

log里面从上到下4个请求分别是:

  • curl checkip.amazonaws.com -x http://127.0.0.1:8001
  • curl checkip.amazonaws.com -x socks5://127.0.0.1:8001
  • curl checkip.amazonaws.com -x http://127.0.0.1:8002
  • curl checkip.amazonaws.com -x socks5://127.0.0.1:8003
    其中只有socks5的两个请求成功分流(proxy1),http的都匹配到最终规则(proxy2)
@ykelvis ykelvis added the bug Something isn't working label Apr 4, 2024
wwqgtxx added a commit that referenced this issue Apr 4, 2024
@wwqgtxx
Copy link
Collaborator

wwqgtxx commented Apr 4, 2024

试过 c893e3c 了么

@ykelvis
Copy link
Author

ykelvis commented Apr 4, 2024

试了一下,http的问题解决了。但我发现tproxy也有同样的问题...

@wwqgtxx
Copy link
Collaborator

wwqgtxx commented Apr 4, 2024

试了一下,http的问题解决了。但我发现tproxy也有同样的问题...

你说的是tcp还是udp还是两者都有

@ykelvis
Copy link
Author

ykelvis commented Apr 4, 2024

tcp有问题,udp看log有在被分流没有问题

@wwqgtxx
Copy link
Collaborator

wwqgtxx commented Apr 4, 2024

tcp有问题,udp看log有在被分流没有问题

试试 #1162

@ykelvis
Copy link
Author

ykelvis commented Apr 4, 2024

最新的build修好tproxy了,谢谢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants