Files
XTLS_Xray-docs-next/docs/en/config/outbounds/trojan.md
T
2026-05-25 18:39:42 +08:00

53 lines
1.1 KiB
Markdown

# Trojan
[Trojan](https://trojan-gfw.github.io/trojan/protocol) protocol.
::: danger
Trojan is designed to work over a correctly configured encrypted TLS tunnel.
:::
## OutboundConfigurationObject
`OutboundConfigurationObject` corresponds to the `settings` item in [`OutboundObject`](../outbound.md).
```json
{
"outbounds": [
{
// ...
"protocol": "trojan",
// [!code focus:7]
"settings": {
"address": "127.0.0.1",
"port": 1234,
"password": "password",
"email": "love@xray.com",
"level": 0
}
}
]
}
```
> `address`: address
Server address. Supports IPv4, IPv6, and domain names. Required.
> `port`: number
Server port. Usually the same as the port the server is listening on.
> `password`: string
Password. Required, any string.
> `email`: string
Email address. Optional, used to identify the user.
> `level`: number
User level. Connections will use the [Local Policy](../policy.md#levelpolicyobject) corresponding to this user level.
The value of `level` corresponds to the value of `level` in [policy](../policy.md#policyobject). If not specified, it defaults to 0.