This section will tell you all the details of Xray configuration. By mastering these contents, Xray will unleash its full power in your hands.

Overview

The configuration file of Xray is in JSON format, and the configuration format for the client and server is the same, except for the actual configuration content. It takes the following form:

{
  "log": {},
  "api": {},
  "dns": {},
  "routing": {},
  "policy": {},
  "inbounds": [],
  "outbounds": [],
  "transport": {},
  "stats": {},
  "reverse": {},
  "fakedns": {}
}

Warning

If you are new to Xray, you can first click to view configuration and running in the Quick Start guide, to learn the most basic configuration method, and then refer to the contents of this section to master all the configuration methods of Xray.

Basic Configuration Modules

log:LogObject

Log configuration, which controls the way Xray outputs logs.

api:ApiObject

Provides some API interfaces for remote calls.

dns: DnsObject

Built-in DNS server. If this item is not configured, the system's DNS settings will be used.

routing: RoutingObject

Routing function. You can set rules to route data to different outbounds.

policy: PolicyObject

Local policy, which can set different user levels and corresponding policy settings.

inbounds: [ InboundObject ]

An array, with each element being an inbound connection configuration.

outbounds: [ OutboundObject ]

An array, with each element being an outbound connection configuration.

transport: TransportObject

Used to configure the way Xray establishes and uses network connections with other servers.

stats: StatsObject

Used to configure traffic data statistics.

reverse: ReverseObject

Reverse proxy. You can forward server-side traffic to the client, that is, reverse traffic forwarding.

fakedns: FakeDnsObject

FakeDNS configuration. It can be used with transparent proxy to obtain the actual domain name.