Skip to content

Sniff: Routing “attrs” support non http inbound#3808

Merged
yuhan6665 merged 5 commits intomainfrom
attr-sniff
Sep 13, 2024
Merged

Sniff: Routing “attrs” support non http inbound#3808
yuhan6665 merged 5 commits intomainfrom
attr-sniff

Conversation

@Fangliding
Copy link
Member

@Fangliding Fangliding commented Sep 13, 2024

在看QUIC sniffer的时候顺便读了一下其他sniffer的代码 之前写配置用到attrs结果无效 问了之后才发现只有http入站才支持这个字段 明明可以嗅探host头 为什么不嗅探其他http头呢
现在sniffer可以直接从http流量中嗅探出http头(以及方法和路径)供路由模块使用 不再要求http入站
http入站如果收到的不是connect方法则会跳过这个嗅探 确保行为不会变化

@Fangliding Fangliding changed the title sniff: 支持非http入站使用attrs进行路由 Sniff: 支持非http入站使用attrs进行路由 Sep 13, 2024
@yuhan6665 yuhan6665 changed the title Sniff: 支持非http入站使用attrs进行路由 Sniff: Routing “attrs” support non http inbound Sep 13, 2024
@yuhan6665
Copy link
Member

感谢 读了一下可以理解嗅探其他http头

不再要求http入站

这个是怎么做的?

@Fangliding
Copy link
Member Author

感谢 读了一下可以理解嗅探其他http头

不再要求http入站

这个是怎么做的?

以前见 https://xtls.github.io/config/routing.html#ruleobject

目前只有 http 入站代理会设置这一属性。

以前这个attrs是通过HTTP入站 HTTP代理有一个工作模式 直接把一个稍微不一样的HTTP请求发给HTTP代理 服务端识别里面的目标然后转发 这个过程中顺便把其他HTTP参数加入 attrs(有别于其他大多数协议握手完后面是直接的TCP流量) 所以对于 CONNECT方法的HTTP入站或者socks5入站 vless入站是没有attrs用的

现在在嗅探里加入功能也往attrs写数据 供路由模块使用

@yuhan6665 yuhan6665 merged commit 88ae774 into main Sep 13, 2024
@yuhan6665
Copy link
Member

看懂了 感谢!

leninalive pushed a commit to amnezia-vpn/amnezia-xray-core that referenced this pull request Oct 29, 2024
* Sniff: Support attrs route in non http inbound

* Add capability to sniff method and path

* Fix test

* Skip HTTP inbound PlainHTTP mode

* Fix test
again
@yuhan6665 yuhan6665 deleted the attr-sniff branch November 4, 2024 17:52
it2konst pushed a commit to it2konst/gametunnel-core that referenced this pull request Mar 1, 2026
* Sniff: Support attrs route in non http inbound

* Add capability to sniff method and path

* Fix test

* Skip HTTP inbound PlainHTTP mode

* Fix test
again
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

Successfully merging this pull request may close these issues.

2 participants