2021-05-26 11:05:53 +00:00
# Trojan
2023-06-14 14:17:07 +00:00
The [Trojan ](https://trojan-gfw.github.io/trojan/protocol ) protocol.
2021-05-26 11:05:53 +00:00
::: danger
2023-06-14 14:17:07 +00:00
Trojan is designed to work with correctly configured encrypted TLS tunnels.
2021-05-26 11:05:53 +00:00
:::
## InboundConfigurationObject
```json
{
"clients": [
{
"password": "password",
"email": "love@xray.com",
2023-03-07 04:01:32 +00:00
"level": 0
2021-05-26 11:05:53 +00:00
}
],
"fallbacks": [
{
"dest": 80
}
]
}
```
> `clients`: \[ [ClientObject](#clientobject) \]
2023-06-14 14:17:07 +00:00
An array representing a group of users approved by the server.
2021-05-26 11:05:53 +00:00
2023-06-14 14:17:07 +00:00
Each item in the array is a user [ClientObject ](#clientobject ).
2021-05-26 11:05:53 +00:00
2023-03-04 16:39:44 +00:00
> `fallbacks`: \[ [FallbackObject](../features/fallback.md) \]
2021-05-26 11:05:53 +00:00
2023-06-14 14:17:07 +00:00
An array that contains a series of powerful fallback configurations (optional). The specific configuration for `fallbacks` can be found in the [FallbackObject ](../features/fallback.md#fallbacks-configuration ) documentation.
2021-05-26 11:05:53 +00:00
::: tip
2023-06-14 14:17:07 +00:00
Xray's Trojan has full support for fallbacks, and the configuration is identical. The conditions triggering fallback are similar to VLESS: first packet length < 58 or the 57th byte is not `\r` ( because Trojan does not have a protocol version ) or authentication failure .
2021-05-26 11:05:53 +00:00
:::
### ClientObject
```json
{
"password": "password",
"email": "love@xray.com",
2023-03-07 04:01:32 +00:00
"level": 0
2021-05-26 11:05:53 +00:00
}
```
> `password`: string
2023-06-14 14:17:07 +00:00
Required. Any string.
2021-05-26 11:05:53 +00:00
> `email`: string
2023-06-14 14:17:07 +00:00
Email address. Optional. Used to identify the user.
2021-05-26 11:05:53 +00:00
::: danger
2023-06-14 14:17:07 +00:00
If there are multiple `ClientObject` s, please make sure that the email addresses are not duplicated.
2021-05-26 11:05:53 +00:00
:::
> `level`: number
2023-06-14 14:17:07 +00:00
The user level that the connection will use to determine the corresponding [Local Policy ](../policy.md#levelpolicyobject ).
2021-05-26 11:05:53 +00:00
2023-06-14 14:17:07 +00:00
The value of `level` corresponds to the value of `level` in the [policy ](../policy.md#policyobject ). If not specified, the default value is 0.