添加 `loopback` 出站的简易使用说明 (#478)

* Add `loopback` pages to sidebar

* Add usage for `loopback`
pull/479/head
Kobe Arthur Scofield 9 months ago committed by GitHub
parent 17748f2b7b
commit dd6fe6c41b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -49,6 +49,7 @@ export const sidebarEn: SidebarConfig = {
'/en/config/outbounds/dns.md',
'/en/config/outbounds/freedom.md',
'/en/config/outbounds/http.md',
'/en/config/outbounds/loopback.md',
'/en/config/outbounds/shadowsocks.md',
'/en/config/outbounds/socks.md',
'/en/config/outbounds/trojan.md',

@ -49,6 +49,7 @@ export const sidebarZh: SidebarConfig = {
'/config/outbounds/dns.md',
'/config/outbounds/freedom.md',
'/config/outbounds/http.md',
'/config/outbounds/loopback.md',
'/config/outbounds/shadowsocks.md',
'/config/outbounds/socks.md',
'/config/outbounds/trojan.md',

@ -15,3 +15,43 @@ Loopback 是个出站数据协议,其作用为将经该出站传出的数据
用于重新路由的入站协议标识。
该标识可以在路由中用于 `inboundTag` ,表示该出站中的数据可以被对应的路由规则再次处理。
### 如何使用?
如果需要将已经通过路由规则分流过的流量再由其它路由规则做更细致的分流,比如由同一组路由规则分流后的 TCP 流量和 UDP 要走不同的出站,则可以使用 `loopback` 出站完成。
``` jsonc
{
"outbounds": [
{
"protocol": "loopback",
"tag": "need-to-split",
"settings": {
"tag": "traffic-input" // 该 tag 在下方用于 RuleObject 的 inboundTag
}
},
{
"tag": "tcp-output",
// protocol, settings, streamSettings 之类的设置
},
{
"tag": "udp-output",
// protocol, settings, streamSettings 之类的设置
}
],
"routing": {
"rules": [
{
"inboundTag": ["traffic-input"], // loopback 设定的 tag
"network": "tcp",
"outboundTag": "tcp-output"
},
{
"inboundTag": ["traffic-input"], // loopback 设定的 tag
"network": "udp",
"outboundTag": "udp-output"
}
]
}
}
```

@ -15,3 +15,43 @@ Loopback is an outbound protocol. It can send traffics through corresponding out
Use as an inbound tag for routing.
This tag can be used as `inboundTag` in routing rules, all traffics going through this outbound can be rerouted with routing rules with corresponding inbound tag.
### How to use?
If you need to do some more detailed routing for traffics that have been routed by routing rules, like splitting routed traffics to TCP traffics and UDP traffics and send them to different outbounds, this can be done with `loopback` outbound.
``` jsonc
{
"outbounds": [
{
"protocol": "loopback",
"tag": "need-to-split",
"settings": {
"tag": "traffic-input" // This tag will be used as the inboundTag inside the RuleObject
}
},
{
"tag": "tcp-output",
// protocol, settings, streamSettings etc.
},
{
"tag": "udp-output",
// protocol, settings, streamSettings etc.
}
],
"routing": {
"rules": [
{
"inboundTag": ["traffic-input"], // tag set in the loopback outbound setting
"network": "tcp",
"outboundTag": "tcp-output"
},
{
"inboundTag": ["traffic-input"], // tag set in the loopback outbound
"network": "udp",
"outboundTag": "udp-output"
}
]
}
}
```
Loading…
Cancel
Save