Xray-docs-next/docs/en/config/inbounds/trojan.md

1.7 KiB

Trojan

The Trojan protocol.

::: danger Trojan is designed to work with correctly configured encrypted TLS tunnels. :::

InboundConfigurationObject

{
  "clients": [
    {
      "password": "password",
      "email": "love@xray.com",
      "level": 0
    }
  ],
  "fallbacks": [
    {
      "dest": 80
    }
  ]
}

clients: [ ClientObject ]

An array representing a group of users approved by the server.

Each item in the array is a user ClientObject.

fallbacks: [ FallbackObject ]

An array that contains a series of powerful fallback configurations (optional). The specific configuration for fallbacks can be found in the FallbackObject documentation.

::: tip 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. :::

ClientObject

{
  "password": "password",
  "email": "love@xray.com",
  "level": 0
}

password: string

Required. Any string.

email: string

Email address. Optional. Used to identify the user.

::: danger If there are multiple ClientObjects, please make sure that the email addresses are not duplicated. :::

level: number

The user level that the connection will use to determine the corresponding Local Policy.

The value of level corresponds to the value of level in the policy. If not specified, the default value is 0.