V2Fly.orgV2Fly.org
Quick Start
Config Reference
Config Reference (v5, WIP)
Tools
Developer Guide
New concise guide
  • 简体中文
  • English
GitHub
Quick Start
Config Reference
Config Reference (v5, WIP)
Tools
Developer Guide
New concise guide
  • 简体中文
  • English
GitHub
  • Config Reference

    • Configuration File Format (Draft)
    • Inbounds
    • Outbounds
    • Proxy Protocol
    • Stream
    • Service
    • DNS
    • Router
    • Geo
  • Proxy Protocol

    • Blackhole
    • DNS
    • Dokodemo
    • Freedom
    • HTTP
    • Socks
    • VMess
    • VLite
    • Shadowsocks
    • Shadowsocks2022
    • Trojan
      • Trojan Inbound (simplified)
        • Structure
        • Fields
      • Trojan Outbound (simplified)
        • Structure
        • Fields
      • Trojan Inbound (complete)
        • Structure
        • Fields
      • Trojan Outbound (complete)
        • Structure
      • AccountObject
        • Structure
        • Fields
      • FallbackObject
        • Structure
        • Fields
    • Hysteria2
    • VLESS
    • Loopback
  • Stream Transport Protocol

    • TCP
    • WebSocket
    • KCP(mKCP)
    • gRPC
    • QUIC
    • Meek
    • HTTPUpgrade
    • Hysteria2
    • mekya
  • Service

    • Stats
    • Policy
    • Browser Forwarder
    • Burst Observatory
    • Background Observatory
    • Tun
    • Subscription Manager
    • File System Storage

Trojan

Tips

Trojan is designed to operate in correctly configured TLS connections, as it does not provide encryption on its own.

Trojan Inbound (simplified)

  • Name: trojan
  • Type: Inbound Protocol
  • ID: inbound.trojan

Structure

{
  "users": [],
  "packetEncoding": "None"
}

Fields

users : [string]

A set of recognized password for this inbound.

packetEncoding: ["None" | "Packet"]

UDP packet encoding method,None by default。(v5.4.0+)

When this value is None , UDP connections will be split into streams based on their destination (Address and Port-Dependent Mapping)。

When this value is Packet, UDP connections from a single source connection will be encoded as UDP packet addr connection, which will be restored to its original form by a supported outbound as an Endpoint Independent Mapping UDP connection. This UDP behaviour is also known as FullCone or NAT1.

Trojan Outbound (simplified)

  • Name: trojan
  • Type: Outbound Protocol
  • ID: outbound.trojan

Structure

{
  "address": "",
  "port": 0,
  "password": ""
}

Fields

address: string

The server address. Both IP and domain name is supported.

port: number

The server port number.

password: string

A password recognized by server.

Trojan Inbound (complete)

  • Name: #v2ray.core.proxy.trojan.ServerConfig

Structure

{
  "users": [],
  "packetEncoding": "None",
  "fallbacks": []
}

Fields

users: [UserObject]

packetEncoding: ["None" | "Packet"]

fallbacks: [FallbackObject]

Trojan Outbound (complete)

  • Name: #v2ray.core.proxy.trojan.ClientConfig

Structure

{
  "server": []
}

server: [ServerEndpoint]

AccountObject

Structure

{
  "@type": "v2ray.core.proxy.trojan.Account",
  "password": ""
}

Fields

@type: "v2ray.core.proxy.trojan.Account"

password: string

FallbackObject

Structure

{
  "alpn": "",
  "path": "",
  "type": "",
  "dest": "",
  "xver": 0
}

Fields

alpn: string

path: string

type: string

dest: string

xver: uint64

Edit this page on GitHub
Last Updated:
Contributors: Shelikhoo, 秋のかえで, mkmark
Prev
Shadowsocks2022
Next
Hysteria2