Trojan Rust

Trojan Relay

Multi-hop relay chain for routing traffic through intermediate nodes

trojan-relay enables multi-hop relay chains for routing traffic through intermediate nodes before reaching the exit server. Each hop can independently use TLS or plain TCP transport.

Overview

Single hop:    Client ──▶ A(entry) ──▶ C(trojan-server) ──▶ Target
Multi-hop:     Client ──▶ A(entry) ──▶ B1(relay) ──▶ B2(relay) ──▶ C(trojan-server) ──▶ Target

Node Roles

RoleNameResponsibility
AEntry NodeAccepts client connections, builds tunnels through relay chain
BRelay NodeVerifies relay password, connects to next hop, forwards traffic
CExit NodeStandard trojan-server, unchanged

Design Principles

  • A does not parse Trojan protocol — Pure transparent forwarding
  • B does not know the final target — Only knows the next hop
  • C requires no changes — Standard trojan-server
  • Client is unaware of the chain — Configures A's address and C's password only
  • Pluggable transports — Each hop can independently use TLS or plain TCP

Quick Start

Entry Node

trojan entry -c entry.toml

Relay Node

trojan relay -c relay.toml

The exit node is a standard trojan server — no changes required.

On this page