mirror of
https://github.com/XTLS/Xray-docs-next.git
synced 2026-09-28 09:58:06 +03:00
49 lines
1.6 KiB
Markdown
49 lines
1.6 KiB
Markdown
# Loopback
|
|
|
|
Loopback is a loopback outbound used to send traffic back to routing for further processing without leaving the core.
|
|
|
|
::: tip Uses
|
|
|
|
- In places where only an outbound can be specified and `balancerTag` cannot be written directly, Loopback can be used to indirectly use a balancer.<br>
|
|
For example, `dialerProxy` in chained proxies, and `fallbackTag` in load balancing.
|
|
- After traffic has already been routed once, it can be further subdivided based on more conditions.<br>
|
|
For example, TCP traffic and UDP traffic routed by the same set of routing rules can be sent to different outbounds.
|
|
|
|
:::
|
|
|
|
::: warning Avoid Loops
|
|
|
|
Avoid letting rules or balancers after the loopback select the original outbound again, otherwise it may form an `outbound -> Loopback -> routing -> original outbound` loop.
|
|
|
|
:::
|
|
|
|
## OutboundConfigurationObject
|
|
|
|
`OutboundConfigurationObject` corresponds to the `settings` item in [`OutboundObject`](../outbound.md).
|
|
|
|
```json
|
|
{
|
|
"outbounds": [
|
|
{
|
|
// ...
|
|
"protocol": "loopback",
|
|
// [!field focus]
|
|
"settings": {
|
|
"inboundTag": "TagUseAsInbound",
|
|
"sniffing": {}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
```
|
|
|
|
> `inboundTag`: string
|
|
|
|
The inbound tag used when re-entering routing.
|
|
|
|
This tag can be used as `inboundTag` in routing, indicating that data from this outbound will re-enter routing with this tag and be processed again by the corresponding rules.
|
|
|
|
> `sniffing`: [SniffingObject](../inbound.md#sniffingobject)
|
|
|
|
Traffic sniffing. The specific configuration is the same as that of [Inbound](../inbound.md#sniffingobject). Disabled by default.
|