mirror of
https://github.com/XTLS/Xray-docs-next.git
synced 2025-04-07 07:13:36 +03:00
Root config object and transport configs.
This commit is contained in:
parent
1a2b3ebd8f
commit
8694ef0445
3 changed files with 61 additions and 51 deletions
|
@ -91,9 +91,9 @@
|
|||
"tcpKeepAliveInterval": 0,
|
||||
"tcpKeepAliveIdle": 300,
|
||||
"tcpUserTimeout": 10000,
|
||||
"tcpcongestion": "bbr",
|
||||
"tcpCongestion": "bbr",
|
||||
"interface": "wg0",
|
||||
"V6Only": false,
|
||||
"v6only": false,
|
||||
"tcpWindowClamp": 600,
|
||||
"tcpMptcp": false,
|
||||
"tcpNoDelay": false
|
||||
|
|
|
@ -21,7 +21,8 @@ The configuration file of Xray is in JSON format, and the configuration format f
|
|||
"transport": {},
|
||||
"stats": {},
|
||||
"reverse": {},
|
||||
"fakedns": {}
|
||||
"fakedns": {},
|
||||
"metrics": {}
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -33,47 +34,47 @@ If you are new to Xray, you can first click to view [configuration and running i
|
|||
|
||||
> log:[LogObject](./log.md)
|
||||
|
||||
Log configuration, which controls the way Xray outputs logs.
|
||||
Log configurations, controlling how Xray emits logs.
|
||||
|
||||
> api:[ApiObject](./api.md)
|
||||
|
||||
Provides some API interfaces for remote calls.
|
||||
Configures how Xray provides API interfaces for calling remotely.
|
||||
|
||||
> dns: [DnsObject](./dns.md)
|
||||
|
||||
Built-in DNS server. If this item is not configured, the system's DNS settings will be used.
|
||||
Configures the built-in DNS server. System DNS will be used if not configured.
|
||||
|
||||
> routing: [RoutingObject](./routing.md)
|
||||
|
||||
Routing function. You can set rules to route data to different outbounds.
|
||||
Configures routing. Specify rules to route connections through different outbounds.
|
||||
|
||||
> policy: [PolicyObject](./policy.md)
|
||||
|
||||
Local policy, which can set different user levels and corresponding policy settings.
|
||||
Local policy configurations, specifying different user levels and corresponding policies.
|
||||
|
||||
> inbounds: \[ [InboundObject](./inbound.md) \]
|
||||
|
||||
An array, with each element being an inbound connection configuration.
|
||||
An array of inbound connection configurations.
|
||||
|
||||
> outbounds: \[ [OutboundObject](./outbound.md) \]
|
||||
|
||||
An array, with each element being an outbound connection configuration.
|
||||
An array of outbound connection configurations.
|
||||
|
||||
> transport: [TransportObject](./transport.md)
|
||||
|
||||
Used to configure the way Xray establishes and uses network connections with other servers.
|
||||
Configures how Xray establishes and uses network connections to other servers.
|
||||
|
||||
> stats: [StatsObject](./stats.md)
|
||||
|
||||
Used to configure traffic data statistics.
|
||||
Configures traffic statistics.
|
||||
|
||||
> reverse: [ReverseObject](./reverse.md)
|
||||
|
||||
Reverse proxy. You can forward server-side traffic to the client, that is, reverse traffic forwarding.
|
||||
Configures the built-in reverse proxy. You can forward server traffic to the client, effectively achieving reverse proxying.
|
||||
|
||||
> fakedns: [FakeDnsObject](./fakedns.md)
|
||||
|
||||
FakeDNS configuration. It can be used with transparent proxy to obtain the actual domain name.
|
||||
FakeDNS configuration. Can be used with a transparent proxy to obtain the actual domains.
|
||||
|
||||
> metrics: [metricsObject](./metrics.md)
|
||||
|
||||
|
|
|
@ -1,20 +1,20 @@
|
|||
# Transport Protocol
|
||||
# Transport
|
||||
|
||||
Transport protocol is the way that Xray nodes communicate with each other.
|
||||
Transports specify how Xray communicates with peers.
|
||||
|
||||
Transport protocol specifies a stable way to transmit data. Typically, both ends of a network connection need to use the same transport protocol to establish a connection. For example, if one end uses WebSocket, the other end must also use WebSocket, otherwise the connection cannot be established.
|
||||
Transports specify how to achieve stable data transmission. Both ends of a connection often need to specify the same transport protocol to successfully establish a connection. Like, if one end uses WebSocket, the other end must also use WebSocket, or else the connection cannot be established.
|
||||
|
||||
Transport protocol configuration has two parts:
|
||||
Transport configuration consists of two parts:
|
||||
|
||||
1. Global configuration ([TransportObject](#transportobject))
|
||||
2. Local configuration ([StreamSettingsObject](#streamsettingsobject)).
|
||||
1. Global config ([TransportObject](#transportobject))
|
||||
2. Local config ([StreamSettingsObject](#streamsettingsobject)).
|
||||
|
||||
- When configuring locally, you can specify how each individual inbound or outbound connection is transmitted.
|
||||
- Typically, the inbound and outbound connections corresponding to the client and server need to use the same transport protocol. When a transport protocol is specified but no specific settings are provided, the transport protocol will use the settings from the global configuration.
|
||||
- When locally configured, you can specify how each inbound or outbound connection is transmitted individually.
|
||||
- Server inbounds and client outbounds often need to use the same transport protocol. When a transport protocol is specified without local configs, the transport will fall back to global transport configs.
|
||||
|
||||
## TransportObject
|
||||
|
||||
The `TransportObject` corresponds to the `transport` item in the configuration file.
|
||||
The `TransportObject` corresponds to the `transport` property in the config root.
|
||||
|
||||
```json
|
||||
{
|
||||
|
@ -33,39 +33,39 @@ The `TransportObject` corresponds to the `transport` item in the configuration f
|
|||
|
||||
> `tcpSettings`: [TcpObject](./transports/tcp.md)
|
||||
|
||||
Configuration for TCP connections.
|
||||
Configures TCP connections.
|
||||
|
||||
> `kcpSettings`: [KcpObject](./transports/mkcp.md)
|
||||
|
||||
Configuration for mKCP connections.
|
||||
Configures mKCP connections.
|
||||
|
||||
> `wsSettings`: [WebSocketObject](./transports/websocket.md)
|
||||
|
||||
Configuration for WebSocket connections.
|
||||
Configures WebSocket connections.
|
||||
|
||||
> `httpSettings`: [HttpObject](./transports/h2.md)
|
||||
|
||||
Configuration for HTTP/2 connections.
|
||||
Configures HTTP/2 connections.
|
||||
|
||||
> `quicSettings`: [QuicObject](./transports/quic.md)
|
||||
|
||||
Configuration for QUIC connections.
|
||||
Configures QUIC connections.
|
||||
|
||||
> `grpcSettings`: [GRPCObject](./transports/grpc.md)
|
||||
|
||||
Configuration for gRPC connections.
|
||||
Configures gRPC connections.
|
||||
|
||||
> `httpupgradeSettings`: [HttpUpgradeObject](./transports/httpupgrade.md)
|
||||
|
||||
Configuration for HTTPUpgrade connections.
|
||||
Configures HTTPUpgrade connections.
|
||||
|
||||
> `dsSettings`: [DomainSocketObject](./transports/domainsocket.md)
|
||||
|
||||
Configuration for Domain Socket connections.
|
||||
Configures Domain Socket connections.
|
||||
|
||||
## StreamSettingsObject
|
||||
|
||||
`StreamSettingsObject` corresponds to the `streamSettings` item in inbound or outbound configuration. Each inbound or outbound can be configured with different transport settings and can use `streamSettings` to perform some transport configurations.
|
||||
`StreamSettingsObject` corresponds to the `streamSettings` property in the inbound or outbound config. Each inbound or outbound can be configured with different transports and can use `streamSettings` to specify local configs.
|
||||
|
||||
```json
|
||||
{
|
||||
|
@ -82,75 +82,84 @@ Configuration for Domain Socket connections.
|
|||
"httpupgradeSettings": {},
|
||||
"sockopt": {
|
||||
"mark": 0,
|
||||
"tcpMaxSeg": 1440,
|
||||
"tcpFastOpen": false,
|
||||
"tproxy": "off",
|
||||
"domainStrategy": "AsIs",
|
||||
"dialerProxy": "",
|
||||
"acceptProxyProtocol": false,
|
||||
"tcpKeepAliveInterval": 0
|
||||
"tcpKeepAliveInterval": 0,
|
||||
"tcpKeepAliveIdle": 300,
|
||||
"tcpUserTimeout": 10000,
|
||||
"tcpCongestion": "bbr",
|
||||
"interface": "wg0",
|
||||
"v6only": false,
|
||||
"tcpWindowClamp": 600,
|
||||
"tcpMptcp": false,
|
||||
"tcpNoDelay": false
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
> `network`: "tcp" | "kcp" | "ws" | "http" | "quic" | "grpc" | "httpupgrade"
|
||||
|
||||
The type of transport used by the connection's data stream, with a default value of `"tcp"`.
|
||||
The underlying protocol of the transport used by the data stream of the connection, defaulting to `"tcp"`.
|
||||
|
||||
> `security`: "none" | "tls" | "reality"
|
||||
|
||||
Whether to enable transport layer encryption, with supported options:
|
||||
Whether to enable transport layer encryption. Supported options below.
|
||||
|
||||
- `"none"` means no encryption (default value).
|
||||
- `"tls"` means using [TLS](https://en.wikipedia.org/wiki/transport_Layer_Security).
|
||||
- `"xtls"` means using [XTLS](./features/xtls.md). <Badge text="Deprecated" type="warning"/>
|
||||
- `"none"` enables no encryption (default).
|
||||
- `"tls"` enables encryption with [TLS](https://en.wikipedia.org/wiki/transport_Layer_Security).
|
||||
- `"xtls"` enables encryption with REALITY.
|
||||
|
||||
> `tlsSettings`: [TLSObject](#tlsobject)
|
||||
|
||||
TLS configuration. TLS is provided by Golang, and usually the result of TLS negotiation is to use TLS 1.3, and DTLS is not supported.
|
||||
Configures vanilla TLS. The TLS encryption suite is provided by Golang, which often uses TLS 1.3, and has no support for DTLS.
|
||||
|
||||
> `xtlsSettings`: [XTLSObject](#tlsobject) <Badge text="Deprecated" type="warning"/>
|
||||
> `realitySettings`: [RealityObject](#realityobject)
|
||||
|
||||
XTLS configuration. XTLS is Xray's original technology, which is the core driver of Xray's outstanding performance. XTLS has the same security as TLS and uses the same configuration as TLS.
|
||||
Configures REALITY. REALITY is a piece of advanced encryption technology developed in-house, with higher security than vanilla TLS, but configs of both are largely the same.
|
||||
|
||||
::: tip
|
||||
TLS/XTLS is currently the most secure transport encryption scheme, and its traffic appears consistent with normal web traffic to outsiders. Enabling XTLS and configuring the appropriate XTLS flow control mode can provide several times to even more than ten times the performance improvement while maintaining the same security as TLS. When changing the value of `security` from `tls` to `xtls`, simply modify `tlsSettings` to `xtlsSettings`.
|
||||
REALITY is by far the most secure transport encryption solution, perfectly mimicking normal web browsing when observed. Enabling REALITY with appropriate XTLS Vision flow control schemes has the potential of reaching magnitudes of performance boosts.
|
||||
:::
|
||||
|
||||
> `tcpSettings`: [TcpObject](./transports/tcp.md)
|
||||
|
||||
The TCP configuration for the current connection, only valid when TCP is used for this connection. The configuration is the same as the global configuration above.
|
||||
Configures the current TCP connection. Valid only when TCP is used. Same schema as global.
|
||||
|
||||
> `kcpSettings`: [KcpObject](./transports/mkcp.md)
|
||||
|
||||
The mKCP configuration for the current connection, only valid when mKCP is used for this connection. The configuration is the same as the global configuration above.
|
||||
Configures the current mKCP connection. Valid only when mKCP is used. Same schema as global.
|
||||
|
||||
> `wsSettings`: [WebSocketObject](./transports/websocket.md)
|
||||
|
||||
The WebSocket configuration for the current connection, only valid when WebSocket is used for this connection. The configuration is the same as the global configuration above.
|
||||
Configures the current WebSocket connection. Valid only when WebSocket is used. Same schema as global.
|
||||
|
||||
> `httpSettings`: [HttpObject](./transports/h2.md)
|
||||
|
||||
The HTTP/2 configuration for the current connection, only valid when HTTP/2 is used for this connection. The configuration is the same as the global configuration above.
|
||||
Configures the current HTTP/2 connection. Valid only when HTTP/2 is used. Same schema as global.
|
||||
|
||||
> `quicSettings`: [QUICObject](./transports/quic.md)
|
||||
|
||||
The QUIC configuration for the current connection, only valid when QUIC is used for this connection. The configuration is the same as the global configuration above.
|
||||
Configures the current QUIC connection. Valid only when QUIC is used. Same schema as global.
|
||||
|
||||
> `grpcSettings`: [GRPCObject](./transports/grpc.md)
|
||||
|
||||
The gRPC configuration for the current connection, only valid when gRPC is used for this connection. The configuration is the same as the global configuration above.
|
||||
Configures the current gRPC connection. Valid only when gRPC is used. Same schema as global.
|
||||
|
||||
> `dsSettings`: [DomainSocketObject](./transports/domainsocket.md)
|
||||
|
||||
The Domain socket configuration for the current connection, only valid when Domain socket is used for this connection. The configuration is the same as the global configuration above.
|
||||
Configures the current Domain Socket connection. Valid only when Domain Socket is used. Same schema as global.
|
||||
|
||||
> `httpupgradeSettings`: [HttpUpgradeObject](./transports/httpupgrade.md)
|
||||
|
||||
Configuration of the current HTTPUpragde connection. Valid only when HTTPUpgrade is used by this connection. The configuration schema is the exact same as the global schema.
|
||||
Configures the current HTTPUpragde connection. Valid only when HTTPUpgrade is used. Same schema as global.
|
||||
|
||||
> `sockopt`: [SockoptObject](./chat#sockoptobject)
|
||||
|
||||
Specific configuration for transparent proxies.
|
||||
Configures transparent proxies.
|
||||
|
||||
### TLSObject
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue