Trojan Protocol Explained: Features, Working, Configuration and Benefits

The Trojan protocol is a popular proxy protocol used in modern proxy and VPN-related networking systems. It is designed to carry proxy traffic through TLS-encrypted connections, making its traffic resemble ordinary HTTPS communication.

If you are learning about Xray-core, V2Ray, VLESS, or 3X-UI, understanding the Trojan protocol can help you choose the right configuration for your server.

In this guide, we will explain what Trojan is, how it works, its main features, how to configure it using 3X-UI, and how it compares with other popular proxy protocols.

What Is the Trojan Protocol?

Trojan is a proxy protocol designed to operate over TLS connections. It uses password-based authentication and carries proxy traffic inside an encrypted TLS connection.

Unlike traditional proxy protocols that may have recognizable protocol-specific traffic patterns, Trojan is designed to make its communication resemble normal HTTPS traffic.

It is supported by compatible networking software, including Xray-core.

Trojan is commonly used with:

  • Xray-core
  • Compatible V2Ray clients and servers
  • 3X-UI management panel
  • Supported Android proxy applications
  • Compatible desktop proxy clients

Important: Trojan is a proxy protocol, not a complete VPN service. You need a compatible server, client application, and correctly configured connection to use it.

How Does the Trojan Protocol Work?

The Trojan protocol uses TLS to establish an encrypted connection between the client and server.

Here is a simplified explanation of the process:

  1. A user opens a compatible proxy client.
  2. The client connects to the configured server address and port.
  3. A TLS handshake establishes an encrypted connection.
  4. The client sends its authentication information.
  5. The server checks whether the password is valid.
  6. If authentication succeeds, the server processes the requested proxy traffic.
  7. The server forwards traffic according to its configuration.

If the password is incorrect, the server does not authorize the proxy request.

Trojan can also be configured behind a reverse proxy or with other supported networking arrangements, depending on the server software.

Main Features of the Trojan Protocol

Trojan has several features that make it useful for certain proxy configurations.

1. TLS Encryption

Trojan normally operates through TLS, which provides encryption for communication between the client and server.

This helps protect data while it travels between the two endpoints.

However, TLS configuration must be correct. Certificate problems, hostname mismatches, or outdated software can affect connection security.

2. Password-Based Authentication

Trojan uses passwords to authenticate clients.

An administrator can create separate passwords for different users, depending on the server implementation.

Use strong, unique passwords and avoid sharing them publicly.

3. HTTPS-Like Traffic

Trojan is designed to make proxy communication resemble ordinary HTTPS traffic.

This does not mean that it is indistinguishable from normal website traffic or that it can bypass every firewall.

Actual network behavior depends on the server configuration, TLS implementation, hosting environment, and network conditions.

4. Xray-core Support

Trojan is supported by Xray-core, allowing administrators to manage Trojan-based connections through compatible configurations.

It can also be managed through supported graphical panels such as 3X-UI.

5. Multiple Client Platforms

Trojan can be used on different operating systems when a compatible client is available.

Possible platforms include:

  • Android
  • Windows
  • macOS
  • Linux
  • iOS

Availability and compatibility depend on the specific client application.

6. Flexible Server Configuration

Trojan can be deployed with different server arrangements, including direct TLS termination and supported reverse-proxy setups.

Administrators can choose a configuration based on their domain, certificates, server software, and infrastructure.

What Are the Requirements for Using Trojan?

Before setting up a Trojan server, prepare the following:

RequirementDescription
VPSA Linux server with a public IP address
Operating SystemUbuntu or another supported Linux distribution
DomainA domain name pointing to your server, normally used for TLS
TLS CertificateA valid certificate for the configured hostname
Server SoftwareXray-core or another compatible implementation
Client ApplicationA Trojan-compatible application
Network AccessRequired ports allowed through firewalls

A domain name and valid TLS certificate are commonly used in direct Trojan-over-TLS deployments. Other supported deployment arrangements may have different requirements.

Important Trojan Configuration Settings Explained

When creating a Trojan inbound in 3X-UI, you will see different configuration fields.

Understanding these settings can help prevent common mistakes.

SettingMeaning
ProtocolSelect Trojan
PortPort used by the server
PasswordClient authentication password
NetworkSupported transport, commonly TCP
SecurityTLS or another supported configuration
Server NameHostname used for the TLS connection
CertificateTLS certificate for the hostname
Private KeyCorresponding certificate private key
FlowOptional and dependent on supported configuration

The available fields depend on the installed 3X-UI and Xray-core versions.

How to Configure Trojan Using 3X-UI

If you have already installed 3X-UI on your Ubuntu VPS, you can use its web dashboard to create a Trojan inbound.

Step 1: Open the 3X-UI Dashboard

Open your browser and enter your 3X-UI panel address.

Log in using your administrator username and password.

Navigate to the Inbounds section.

Step 2: Create a New Inbound

Select the option to add a new inbound.

Choose the following basic settings:

  • Protocol: Trojan
  • Port: 443, if available and appropriate for your setup
  • Password: Generate a strong, unique password
  • Network: Select a supported transport
  • Security: Configure TLS if using direct Trojan-over-TLS

Do not use a port that is already occupied by another service.

Step 3: Configure the Domain Name

For a typical direct TLS setup, you should have a domain name pointing to your VPS.

For example:

vpn.example.com

This is an example hostname only.

Check that the domain’s DNS records point to the correct server address.

Step 4: Configure the TLS Certificate

Install or obtain a valid TLS certificate for your domain.

Configure the certificate file and corresponding private key in the appropriate 3X-UI TLS settings.

Make sure:

  • The certificate matches your domain.
  • The certificate is valid and not expired.
  • The private key matches the certificate.
  • The server can access the certificate files.
  • The configured hostname is consistent with the client settings.

If you use a reverse proxy, follow the TLS configuration appropriate to that architecture instead of configuring conflicting TLS termination on multiple services.

Step 5: Add a Trojan Client

Create a client entry in the inbound settings.

Generate a strong password for the client.

Keep the password private. Anyone who obtains valid credentials may be able to use the connection, depending on your server configuration.

Step 6: Save the Configuration

Review the port, password, domain, certificate, and transport settings.

Save the inbound and apply the configuration.

Check the Xray service status if the configuration fails to start.

Step 7: Import the Trojan Profile

After saving the inbound, use the panel’s generated connection link or QR code if available.

Open a compatible client application and import the profile.

Check that the client hostname, port, password, and TLS settings match the server.

Start the connection and test whether it works.

What Does a Trojan Connection Link Look Like?

Trojan profiles are commonly shared through a URI beginning with trojan://.

Here is a simplified example:

trojan://YOUR_PASSWORD@vpn.example.com:443?sni=vpn.example.com#My-Trojan-Server

This is only a template, not a working connection.

The main parts are:

ParameterMeaning
trojan://Identifies the Trojan protocol
YOUR_PASSWORDAuthentication password
vpn.example.comServer hostname
443Example server port
sniTLS server name
#My-Trojan-ServerProfile display name

Additional parameters may be required for particular configurations, including transport and TLS options.

Use the share link generated by your management panel whenever possible.

Trojan vs VLESS vs VMess

Trojan, VLESS, and VMess are different proxy protocols used in modern networking software.

Although they can serve similar purposes, they have different authentication and security approaches.

FeatureTrojanVLESSVMess
AuthenticationPasswordUUIDUUID
Typical securityTLSRequires suitable security layerCommonly configured with TLS or other supported security
Protocol designTLS-based proxy protocolLightweight proxy protocolProxy protocol from the V2Ray ecosystem
Xray supportYesYesYes
Typical useProxy over TLSFlexible modern proxy configurationsExisting V2Ray deployments
Encryption by itselfUses TLS in typical deploymentNoDepends on configured security

Trojan vs VLESS

Trojan commonly relies on TLS for its encrypted connection, while VLESS can be combined with different security and transport configurations, including TLS and REALITY.

The choice depends on compatibility, server architecture, and configuration requirements.

Trojan vs VMess

VMess uses UUID-based client authentication and has its own protocol-specific security mechanisms. Trojan uses password authentication and typically operates over TLS.

Neither protocol is automatically the best option for every deployment.

Advantages of the Trojan Protocol

Trojan offers several useful characteristics.

TLS-based communication: It can protect traffic through standard TLS encryption when correctly configured.

Password authentication: Administrators can assign credentials to individual users.

HTTPS-like behavior: Its design aims to resemble ordinary HTTPS communication.

Xray compatibility: It can be managed through Xray-core and compatible control panels.

Flexible deployment: It can work with direct TLS and other supported server arrangements.

Limitations of the Trojan Protocol

Trojan also has some limitations.

  • Direct TLS deployments require correct certificate management.
  • Incorrect DNS settings can prevent connections.
  • Weak passwords can create security risks.
  • Client compatibility varies.
  • It does not guarantee anonymity.
  • Network filtering may still identify or block connections.
  • Performance depends on server resources, network quality, and configuration.

Understanding these limitations helps administrators choose the right protocol for their needs.

Common Trojan Connection Problems and Solutions

1. Trojan Connection Is Not Working

Check whether the server is running and whether the configured port is reachable.

If you manage the service through 3X-UI, inspect its status:

systemctl status x-ui

2. TLS Certificate Error

A certificate error can occur when the certificate is expired, invalid, or issued for a different hostname.

Check your certificate and domain configuration.

3. Incorrect Password

The password in the client profile must match the password configured on the server.

Check for typing mistakes or outdated connection links.

4. Domain Name Is Not Resolving

Check your DNS records and make sure the domain points to the correct server.

DNS changes may take time to propagate.

5. Port Is Blocked

Check your Ubuntu firewall:

ufw status

Also check the firewall settings of your VPS provider.

6. Trojan Service Is Not Running

Restart the 3X-UI service if appropriate:

systemctl restart x-ui

Then inspect the logs:

journalctl -u x-ui -n 100 –no-pager

Review the error messages before making configuration changes.

7. Client Application Does Not Support the Configuration

Some client applications may not support every transport or TLS option.

Use an updated client that supports your selected Trojan configuration.

Is Trojan Protocol Secure?

Trojan can provide secure communication when correctly configured with TLS.

However, security depends on more than the protocol name.

For better protection:

  • Use a valid TLS certificate.
  • Use strong and unique passwords.
  • Keep Xray-core and 3X-UI updated.
  • Protect your server’s certificate private key.
  • Restrict access to the management panel.
  • Avoid sharing connection links publicly.
  • Review server logging and DNS settings.
  • Download client applications from trusted sources.

Trojan does not guarantee complete anonymity or prevent all forms of network monitoring.

Conclusion

Trojan is a proxy protocol designed to carry proxy traffic through TLS-encrypted connections. It uses password-based authentication and is supported by Xray-core and compatible client applications.

Its HTTPS-like communication design, straightforward authentication model, and flexible deployment options make it useful for different proxy-server configurations.

If you manage an Xray server through 3X-UI, you can create a Trojan inbound, configure TLS, add client credentials, and import the generated profile into a compatible application.

Before using Trojan, make sure your domain, certificate, password, server port, and client settings are configured correctly.

Frequently Asked Questions (FAQs)

1. What is the Trojan protocol?

Trojan is a proxy protocol that typically operates over TLS-encrypted connections and uses password-based authentication.

2. Is Trojan a VPN protocol?

Trojan is technically a proxy protocol rather than a traditional VPN protocol. It can be used by compatible applications to route network traffic through a proxy server.

3. Does Trojan require a domain name?

A domain name is commonly used for direct TLS configurations because the certificate must match the hostname. Other deployment arrangements may have different requirements.

4. Does Trojan use TLS encryption?

Yes. Trojan is designed to operate through TLS connections in its typical deployment, providing encryption between the client and server.

5. Can I use Trojan with Xray-core?

Yes. Xray-core supports Trojan configurations, allowing administrators to manage Trojan proxy connections.

6. Can I configure Trojan in 3X-UI?

Yes. Compatible versions of 3X-UI provide options for creating and managing Trojan inbounds.

7. What is the difference between Trojan and VLESS?

Trojan commonly uses password authentication over TLS, while VLESS uses UUID-based authentication and supports different security arrangements, including TLS and REALITY.

8. Can I use Trojan on Android?

Yes. You can use a compatible Android client that supports the Trojan protocol and your server’s configuration.

9. Is Trojan better than VMess?

It depends on your requirements. Trojan uses password-based authentication and typically relies on TLS, while VMess has its own protocol-specific authentication and security mechanisms.

10. Is Trojan completely anonymous?

No. Trojan does not guarantee complete anonymity. Server providers, DNS settings, client software, and other network components can affect privacy.

11. Which port is commonly used for Trojan?

Port 443 is commonly used for TLS-based Trojan configurations, but the server and client must use the same configured port. Other ports may also be supported.