Sniffer
When Enhanced Mode captures a TCP connection to an address Core cannot name (the application resolved the name on its own, or connected to a hard-coded address), domain rules have nothing to match. The sniffer reads the first bytes the application sends, the HTTP Host or the TLS server name (SNI), and uses that name for routing. It decrypts nothing and changes nothing; the bytes it reads are sent on unchanged.
The sniffer is on by default. You only need [sniffer] to change it.
[sniffer]
enable = true
protocols = ["http", "tls"]
http-ports = [80, 8080]
tls-ports = [443, 8443]
override-destination = true
timeout-ms = 500
max-bytes = 16384Where it applies
| Connection | Sniffed |
|---|---|
| TUN (Windows, macOS), TCP | yes |
| Linux eBPF, TCP | yes |
| Router gateway, TCP from LAN clients | yes |
| Local HTTP/SOCKS5 port | no: the application already sends the name |
| UDP, including QUIC (HTTP/3) | no |
| Connections to a Fake-IP | no: Core already knows the name |
Fields
| Field | Default | Notes |
|---|---|---|
enable | true | |
protocols | ["http", "tls"] | http, tls (alias https), case ignored. When present, only the listed protocols are sniffed; [] sniffs nothing. Other names are dropped with a warning |
http-ports | [80, 8080] | destination ports where an HTTP request is read |
tls-ports | [443, 8443] | destination ports where a TLS ClientHello is read |
override-destination | true | send the sniffed name, not the address, to the proxy; see below |
timeout-ms | 500 | how long to wait for the first bytes; values outside 10–5000 are clamped |
max-bytes | 16384 | how much to read at most; values outside 512–65536 are clamped |
Ports can be a number, a "from-to" range string, or a list of both: tls-ports = [443, "8440-8450"]. A range may span at most 100 ports above its start. An invalid entry is dropped with a warning; the rest of the list still applies.
[sniffer] is a lenient section: an unknown key, or a value of the wrong type, is ignored without an error and the default applies. protocols must be an array: protocols = "tls" turns both protocols off. Check the spelling of keys.
What happens to a connection
- Should it be sniffed? Only if the sniffer is enabled, the destination port is in
http-portsfor an enabledhttp, or intls-portsfor an enabledtls, and the address is not a Fake-IP. - Read. Core reads what the application sends until it finds a name, sees that the data is not HTTP or TLS, has read
max-bytes, ortimeout-mshas passed. - Route. A found name replaces the name Core learned from DNS for this connection.
bypass, the rules andFINALsee the sniffed name and the destination address. Without a name, the connection is routed as it would be without the sniffer. - Connect.
DIRECTalways connects to the original address. A proxy gets the sniffed name whenoverride-destination = true, otherwise the address. The bytes read in step 2 are sent first, exactly once.
What is read
- HTTP: HTTP/1.0 and HTTP/1.1 requests (
GET,HEAD,POST,PUT,DELETE,OPTIONS,PATCH,TRACE,CONNECT). The name comes from theCONNECTtarget, from an absolute URL (GET http://example.com/ …), or from theHostheader. The port in the header is dropped. - TLS: the
server_nameextension of the ClientHello, also when the ClientHello spans several TLS records. - IP addresses and malformed names are ignored: an SNI of
1.2.3.4gives no name.
override-destination
override-destination | Rules see | A proxy receives | DIRECT connects to |
|---|---|---|---|
true (default) | the sniffed name | the sniffed name | the original address |
false | the sniffed name | the original address | the original address |
With true the proxy server resolves the name itself, which usually gives an address close to the proxy server. Use false when an application must reach exactly the address it chose, for example when it connects to a fixed address and sends an SNI that resolves elsewhere.
Rules and DNS
- The sniffed name feeds every domain rule (
DOMAIN*,GEOSITE, domain entries in rule sets and in logical rules) and thebypasslist. IP rules still see the destination address. A rule that matches the name and a rule that matches the address compete by their order, as always. - The sniffer never changes DNS answers. It helps only the connection it read.
- With the default
mode = "fake-ip", names that route through a proxy already arrive as Fake-IPs and are not sniffed. The sniffer matters for connections to real addresses: names routedDIRECT,mode = "real-ip", applications with their own DNS (DNS over HTTPS), and hard-coded addresses. - On Linux eBPF a connection is sniffed only if it is captured. With
FINAL,DIRECT, a connection to an address that no rule selects may never reach Core; see what eBPF captures. - On Windows with
dns-hijack = false, Core answers no DNS and the sniffer is the only source of names.
Limits
- Server-first protocols. On a listed port where the server speaks first (SMTP, FTP, many databases), the application sends nothing at first and the connection waits
timeout-msbefore it is routed. Keep such ports out of the lists. - Encrypted Client Hello (ECH). The visible SNI is the outer, public name of the provider, not the real site. Rules then see that public name.
- Other protocols expose no name: HTTP/2 without TLS, SSH, plain IP protocols. Use IP or process rules for those.
max-bytestoo small. A ClientHello larger thanmax-bytesgives no name. The default is enough for current browsers, including post-quantum key shares.- Ports not in the lists are never sniffed. Add HTTPS services on unusual ports to
tls-ports.
How changes apply
Changing [sniffer] and re-activating the profile applies in place: Enhanced Mode capture is rebuilt with the new settings. On Linux eBPF the whole runtime is rebuilt. Router gateway connections use the new settings from the next connection.
Troubleshooting
| Symptom | Check |
|---|---|
| A domain rule does not match a captured HTTPS connection | Is the port in tls-ports? Does Connections show the destination as a name? Is the application using ECH or QUIC (UDP)? |
| Connections on one port open slowly | The server speaks first on that port; remove the port from the lists |
| A site breaks only through a proxy | Try override-destination = false; the application may rely on the exact address it chose |
Changes to [sniffer] have no effect | A misspelled key or a value of the wrong type is ignored silently |
See also Rules, DNS, TUN and Linux eBPF.
