[GH-ISSUE #5644] [Question]: sniffing #3933

Closed
opened 2026-10-31 20:35:59 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @RezaHaghgoo on GitHub (Jun 28, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5644

What are you trying to do?

what is the function of "sniffing" in configs and its relation to configs' incompatibility when connecting to different internet operators?

What have you already tried?

No response

3x-ui version

3.3.0

How did you install 3x-ui?

install.sh script

Operating system

No response

Screenshots or config snippets

No response

Before submitting

  • I read the Wiki and searched existing issues.
  • This is a usage question, not a bug report.
  • This question is written in English.
Originally created by @RezaHaghgoo on GitHub (Jun 28, 2026). Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5644 ### What are you trying to do? what is the function of "sniffing" in configs and its relation to configs' incompatibility when connecting to different internet operators? ### What have you already tried? _No response_ ### 3x-ui version 3.3.0 ### How did you install 3x-ui? install.sh script ### Operating system _No response_ ### Screenshots or config snippets _No response_ ### Before submitting - [x] I read the [Wiki](https://github.com/MHSanaei/3x-ui/wiki) and searched [existing issues](../issues?q=is%3Aissue). - [x] This is a usage question, not a bug report. - [x] This question is written in English.
bsakaguchi 2026-10-31 20:35:59 +07:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@github-actions[bot] commented on GitHub (Jun 28, 2026):

Sniffing is an Xray-core feature that instructs Xray to inspect the first bytes of each incoming connection and infer the application-layer protocol before routing it. The 3x-ui panel exposes it on the Sniffing tab of every inbound (all protocols except MTProto, confirmed in `frontend/src/lib/xray/protocol-capabilities.ts`).

What it does

When sniffing is enabled, Xray reads the start of the payload and attempts to identify the protocol and, critically, the target hostname:

  • For HTTP: extracts the domain from the `Host` header.
  • For TLS: extracts the domain from the TLS SNI field.
  • For QUIC: extracts the SNI from the QUIC handshake.
  • For FakeDNS: resolves fake-IP addresses back to domain names.

After extracting the domain, Xray substitutes it as the connection's destination address so that the routing engine can match domain-based rules. Without sniffing, a connection that arrived as a raw IP would only match IP-based rules, not domain-based ones.

Configurable options (defined in `frontend/src/schemas/primitives/sniffing.ts`):

Field Default Effect
enabled false Enable/disable sniffing for this inbound
destOverride ["http","tls","quic","fakedns"] Which protocols to sniff; only applies when enabled
metadataOnly false Infer destination from connection metadata (IP/port) rather than payload bytes — avoids reading application data
routeOnly false Use the sniffed domain only for routing; keep the original IP as the actual outbound destination
ipsExcluded [] Skip sniffing for connections to these IPs/CIDRs
domainsExcluded [] Skip sniffing for connections to these domains

Relation to operator-specific incompatibility

Sniffing operates entirely inside Xray on the server side after the connection is already established. It does not alter how the client connects, does not change the TLS handshake or the SNI visible on the wire, and does not modify the transport. It therefore has no direct effect on whether a connection succeeds or fails from different ISPs or mobile operators.

Operator-level incompatibility (connections that work on some networks but not others) is caused by factors at the network layer, not by sniffing: IP or port blocking, DPI fingerprinting of TLS or WebSocket patterns, SNI-based filtering, or differences in how each carrier routes traffic to your server.

The only indirect way sniffing could appear to affect compatibility is if you have routing rules on the server that send certain domains through a specific outbound (e.g., blocking or routing domestic traffic differently). If sniffing is disabled, domain-based routing rules cannot match traffic that arrived by IP, so they fall through to the default outbound — which may behave differently than expected.

If the operator-compatibility issue you mentioned relates to your Tunnel → VLESS+WS+TLS setup, the causes and mitigations were described in the response to your previous question #5641.

This reply was generated automatically; a maintainer may follow up.

<!-- gh-comment-id:4827365383 --> @github-actions[bot] commented on GitHub (Jun 28, 2026): **Sniffing** is an Xray-core feature that instructs Xray to inspect the first bytes of each incoming connection and infer the application-layer protocol before routing it. The 3x-ui panel exposes it on the **Sniffing** tab of every inbound (all protocols except MTProto, confirmed in \`frontend/src/lib/xray/protocol-capabilities.ts\`). **What it does** When sniffing is enabled, Xray reads the start of the payload and attempts to identify the protocol and, critically, the target hostname: - For **HTTP**: extracts the domain from the \`Host\` header. - For **TLS**: extracts the domain from the TLS SNI field. - For **QUIC**: extracts the SNI from the QUIC handshake. - For **FakeDNS**: resolves fake-IP addresses back to domain names. After extracting the domain, Xray substitutes it as the connection's destination address so that the **routing engine** can match domain-based rules. Without sniffing, a connection that arrived as a raw IP would only match IP-based rules, not domain-based ones. **Configurable options** (defined in \`frontend/src/schemas/primitives/sniffing.ts\`): | Field | Default | Effect | |---|---|---| | `enabled` | `false` | Enable/disable sniffing for this inbound | | `destOverride` | `["http","tls","quic","fakedns"]` | Which protocols to sniff; only applies when enabled | | `metadataOnly` | `false` | Infer destination from connection metadata (IP/port) rather than payload bytes — avoids reading application data | | `routeOnly` | `false` | Use the sniffed domain only for routing; keep the original IP as the actual outbound destination | | `ipsExcluded` | `[]` | Skip sniffing for connections to these IPs/CIDRs | | `domainsExcluded` | `[]` | Skip sniffing for connections to these domains | **Relation to operator-specific incompatibility** Sniffing operates entirely inside Xray on the server side after the connection is already established. It does not alter how the client connects, does not change the TLS handshake or the SNI visible on the wire, and does not modify the transport. It therefore has no direct effect on whether a connection succeeds or fails from different ISPs or mobile operators. Operator-level incompatibility (connections that work on some networks but not others) is caused by factors at the network layer, not by sniffing: IP or port blocking, DPI fingerprinting of TLS or WebSocket patterns, SNI-based filtering, or differences in how each carrier routes traffic to your server. The only indirect way sniffing could appear to affect compatibility is if you have routing rules on the server that send certain domains through a specific outbound (e.g., blocking or routing domestic traffic differently). If sniffing is disabled, domain-based routing rules cannot match traffic that arrived by IP, so they fall through to the default outbound — which may behave differently than expected. If the operator-compatibility issue you mentioned relates to your Tunnel → VLESS+WS+TLS setup, the causes and mitigations were described in the response to your previous question #5641. *This reply was generated automatically; a maintainer may follow up.*
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
MHSanaei/3x-ui#3933
No description provided.