DanielLavrushin 说明 b4 的 firstbyte 分包与出口接口排查
在 b4 的 MTProto 连接讨论中,DanielLavrushin 说明,firstbyte 只拆分 TCP 分段,重组后的 ClientHello 字节应保持不变;在增加开关前,需要区分出口路由、MTProxy 实现、运营商网络及其他规则匹配等可能原因。他建议测试将 Capture Interfaces 限定为主 WAN:从其他接口发出的包会不经处理,无论匹配哪个规则集,并据此判断是否还需要新设置。
作者原文@DanielLavrushin@asovetov
Before I add a switch, I'd like to pin down what actually breaks.
firstbyteonly splits the TCP segment: one byte, a short pause, then the rest of the ClientHello. The server's TCP stack puts the same bytes back together, so the FakeTLS check on the proxy should see an unchanged ClientHello. A TCP split alone shouldn't break it, so something else is going on, and the right fix depends on what:
- b4's split segments leave by the main WAN instead of the second uplink. That would be a routing bug in b4, and it would hit every set routed to a plain interface, not only MTProto.
- The MTProxy server mishandles a ClientHello that arrives in two segments.
- The LTE operator's network reacts to the split itself.
- Another set takes the connection by the FakeTLS domain in the ClientHello and applies its own strategy.
Could you send the following, all from one failed attempt?
- Which MTProxy server runs on that IP (mtg, telemt, the official MTProxy, something else), and its version.
- Your b4 version and the System Info JSON from the b4 settings.
- A b4 log at Trace level (Settings, Logging, Log Level) that covers one failed connection, plus the connection-log line for it, which shows the set it matched.
- A capture on both uplinks during the same attempt, for example:
tcpdump -ni eth1 -w uplink2.pcap host <proxy-ip> and tcp port <proxy-port> & tcpdump -ni <main-wan> -w wan.pcap host <proxy-ip> and tcp port <proxy-port> &
We want to see whether both segments of the split ClientHello go out eth1.- With
firstbytestill on, does a plain TLS connection to the same IP through the same set work? If your proxy forwards non-proxy clients to its fronting domain, try this from a LAN client:curl -v --resolve <fronting-domain>:<proxy-port>:<proxy-ip> https://<fronting-domain>:<proxy-port>/- With b4's strategies off, does a blocked site open through the LTE uplink? That tells us whether the path really avoids the censor.
- Does it work if you leave
firstbyteon and set Settings, Packet Engine, Capture Interfaces to your main WAN interface only? With that list, b4 passes every packet that leaves by another interface untouched, whichever set it matched. If that fixes it, the case may already be covered without a new setting.Separately, the branch currently fails two tests in
go test ./...:TestWritablePathsGroundingandTestHelperLinesStayShort. There's no need to fix those yet. Let's settle the approach first.