Skip to content

Loopback outbound: Add "sniffing"#6326

Open
j2rong4cn wants to merge 1 commit into
XTLS:mainfrom
j2rong4cn:loopback-sniffing
Open

Loopback outbound: Add "sniffing"#6326
j2rong4cn wants to merge 1 commit into
XTLS:mainfrom
j2rong4cn:loopback-sniffing

Conversation

@j2rong4cn

Copy link
Copy Markdown
Contributor

为Loopback出站添加流量探测
示例:tun入站白名单

{
  "routing": {
    "rules": [
      {
        "inboundTag": ["tun-in"],
        "process": ["chrome", "firefox"],
        "outboundTag": "loopback-out"
      },
      {
        "inboundTag": ["tun-in"],
        "outboundTag": "direct"
      }
    ]
  },
  "inbounds": [
    {
      "protocol": "tun",
      "settings": {
        "name": "xray0",
        "mtu": 1500,
        "gateway": ["10.0.0.1/16", "fc00::1/64"],
        "dns": ["1.1.1.1"],
        "autoSystemRoutingTable": ["0.0.0.0/0", "::/0"],
        "autoOutboundsInterface": "auto"
      },
      "tag": "tun-in"
    }
  ],
  "outbounds": [
    {
      "protocol": "loopback",
      "settings": {
        "sniffing": {
          "destOverride": ["http", "tls", "quic"],
          "routeOnly": true,
          "enabled": true
        },
        "inboundTag": "loopback-in"
      },
      "tag": "loopback-out"
    }
  ]
}

@Fangliding

Copy link
Copy Markdown
Member

tun也有嗅探功能啊 为什么要扔loopback上

@j2rong4cn

Copy link
Copy Markdown
Contributor Author

tun也有嗅探功能啊 为什么要扔loopback上

减少不必要的嗅探开销呗
{12CB6088-5B1D-4651-9653-44D441864F7F}

@Fangliding

Fangliding commented Jun 14, 2026

Copy link
Copy Markdown
Member

sniff能有多少开销 看开头一个包而已 有gvisor TUN零头吗

@patterniha

Copy link
Copy Markdown
Collaborator

@Fangliding
Apart from this, can you tell me another use for loopback? i thought about it a bit but couldn't find any use.

@Meo597

Meo597 commented Jun 14, 2026

Copy link
Copy Markdown
Collaborator

routing.balancers.fallbackTag 只能是出站,但借由 loopback 可以到另一个 balancer

@Fangliding

Copy link
Copy Markdown
Member

sniff能有多少开销 看开头一个包而已 有gvisor TUN零头吗

如果没有异议的话就算了 因为loopback出站再走一次dispatcher也不是零开销的 后续数据都要多倒一手

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.

4 participants