2023-03-12 01:44:54 +00:00
# Outbound Proxies
2021-05-26 11:05:53 +00:00
2023-03-12 01:44:54 +00:00
Outbound connections are used for sending data and can use any of the available protocols listed in [outbound protocols ](./outbounds/ ).
2021-05-26 11:05:53 +00:00
## OutboundObject
2023-03-12 01:44:54 +00:00
The `OutboundObject` corresponds to a sub-element of the `outbounds` item in the configuration file.
2021-05-26 11:05:53 +00:00
::: tip
2023-03-12 01:44:54 +00:00
The first element in the list serves as the main outbound. When there is no match or no successful match for the routing, the traffic is sent out by the main outbound.
2021-05-26 11:05:53 +00:00
:::
```json
{
"outbounds": [
{
"sendThrough": "0.0.0.0",
2023-03-12 01:44:54 +00:00
"protocol": "protocol name",
2021-05-26 11:05:53 +00:00
"settings": {},
2023-03-12 01:44:54 +00:00
"tag": "identifier",
2021-05-26 11:05:53 +00:00
"streamSettings": {},
"proxySettings": {
"tag": "another-outbound-tag"
},
"mux": {}
}
]
}
```
> `sendThrough`: address
2023-03-12 01:44:54 +00:00
The IP address used to send data. It is effective when the host has multiple IP addresses, and the default value is `"0.0.0.0"` .
2021-05-26 11:05:53 +00:00
> `protocol`: string
2023-03-12 01:44:54 +00:00
The name of the connection protocol. The optional protocol types can be found in [outbound protocols ](./outbounds/ ).
2021-05-26 11:05:53 +00:00
> `settings`: OutboundConfigurationObject
2023-03-12 01:44:54 +00:00
The specific configuration content varies depending on the protocol. See `OutboundConfigurationObject` in each protocol for details.
2021-05-26 11:05:53 +00:00
> `tag`: string
2023-03-12 01:44:54 +00:00
The identifier of this outbound connection, used to locate this connection in other configurations.
2021-05-26 11:05:53 +00:00
::: danger
2023-03-12 01:44:54 +00:00
When it is not empty, its value must be **unique** among all `tag` s.
2021-05-26 11:05:53 +00:00
:::
> `streamSettings`: [StreamSettingsObject](./transport.md#streamsettingsobject)
2023-03-12 01:44:54 +00:00
The underlying transport method is the way the current Xray node and other nodes are docked.
2021-05-26 11:05:53 +00:00
> `proxySettings`: [ProxySettingsObject](#proxysettingsobject)
2023-03-12 01:44:54 +00:00
The outbound proxy configuration. When the outbound proxy takes effect, the `streamSettings` of this outbound will not work.
2021-05-26 11:05:53 +00:00
> `mux`: [MuxObject](#muxobject)
2023-03-12 01:44:54 +00:00
Specific configuration related to Mux.
2021-05-26 11:05:53 +00:00
### ProxySettingsObject
```json
{
"tag": "another-outbound-tag"
}
```
> `tag`: string
2023-03-12 01:44:54 +00:00
When specifying the identifier of another outbound, data emitted by this outbound will be forwarded to the specified outbound.
2021-05-26 11:05:53 +00:00
::: danger
2023-03-12 01:44:54 +00:00
This forwarding method does **not go through** the underlying transport. If you need to use forwarding that supports the underlying transport, please use [SockOpt.dialerProxy ](./transport.md#sockoptobject ).
2021-05-26 11:05:53 +00:00
:::
::: danger
2023-03-12 01:44:54 +00:00
This option is incompatible with SockOpt.dialerProxy.
2021-05-26 11:05:53 +00:00
:::
::: tip
2023-03-12 01:44:54 +00:00
Compatible with v2fly/v2ray-core's configuration [transportLayer ](https://www.v2fly.org/config/outbounds.html#proxysettingsobject ).
2021-05-26 11:05:53 +00:00
:::
### MuxObject
2023-03-12 01:44:54 +00:00
The Mux function distributes the data of multiple TCP connections on a single TCP connection. For implementation details, see [Mux.Cool ](../../development/protocols/muxcool ). Mux is designed to reduce the latency of TCP handshake, not to increase the throughput of connections. Using Mux for watching videos, downloading, or speed testing usually has negative effects. Mux only needs to be enabled on the client side, and the server side automatically adapts.
2021-05-26 11:05:53 +00:00
2023-03-12 01:44:54 +00:00
`MuxObject` corresponds to the `mux` item in `OutboundObject` .
2021-05-26 11:05:53 +00:00
```json
{
"enabled": false,
"concurrency": 8
}
```
> `enabled`: true | false
2023-03-12 01:44:54 +00:00
Whether to enable Mux forwarding requests, default is `false` .
2021-05-26 11:05:53 +00:00
> `concurrency`: number
2023-03-12 01:44:54 +00:00
Maximum concurrent connections. Minimum value is `1` , maximum value is `1024` , default is `8` .
2021-05-26 11:05:53 +00:00
2023-03-12 01:44:54 +00:00
This value represents the maximum number of Mux connections that can be carried on a TCP connection. For example, when `concurrency=8` is set, if the client sends 8 TCP requests, Xray will only send one actual TCP connection, and all 8 requests from the client will be transmitted through this TCP connection.
2021-05-26 11:05:53 +00:00
::: tip
2023-03-12 01:44:54 +00:00
When filling in a negative number, such as `-1` , the mux module is not loaded.
2021-05-26 11:05:53 +00:00
:::