mirror of
https://github.com/okxlin/appstore.git
synced 2025-07-13 21:02:18 +08:00
70 lines
4.1 KiB
TOML
70 lines
4.1 KiB
TOML
[client]
|
|
remote_addr = "example.com:2333" # Necessary. The address of the server
|
|
default_token = "default_token_if_not_specify" # Optional. The default token of services, if they don't define their own ones
|
|
heartbeat_timeout = 40 # Optional. Set to 0 to disable the application-layer heartbeat test. The value must be greater than `server.heartbeat_interval`. Default: 40 seconds
|
|
retry_interval = 1 # Optional. The interval between retry to connect to the server. Default: 1 second
|
|
|
|
[client.transport] # The whole block is optional. Specify which transport to use
|
|
type = "tcp" # Optional. Possible values: ["tcp", "tls", "noise"]. Default: "tcp"
|
|
|
|
[client.transport.tcp] # Optional. Also affects `noise` and `tls`
|
|
proxy = "socks5://user:passwd@127.0.0.1:1080" # Optional. The proxy used to connect to the server. `http` and `socks5` is supported.
|
|
nodelay = true # Optional. Override the `client.transport.nodelay` per service
|
|
keepalive_secs = 20 # Optional. Specify `tcp_keepalive_time` in `tcp(7)`, if applicable. Default: 20 seconds
|
|
keepalive_interval = 8 # Optional. Specify `tcp_keepalive_intvl` in `tcp(7)`, if applicable. Default: 8 seconds
|
|
|
|
[client.transport.tls] # Necessary if `type` is "tls"
|
|
trusted_root = "ca.pem" # Necessary. The certificate of CA that signed the server's certificate
|
|
hostname = "example.com" # Optional. The hostname that the client uses to validate the certificate. If not set, fallback to `client.remote_addr`
|
|
|
|
[client.transport.noise] # Noise protocol. See `docs/transport.md` for further explanation
|
|
pattern = "Noise_NK_25519_ChaChaPoly_BLAKE2s" # Optional. Default value as shown
|
|
local_private_key = "key_encoded_in_base64" # Optional
|
|
remote_public_key = "key_encoded_in_base64" # Optional
|
|
|
|
[client.transport.websocket] # Necessary if `type` is "websocket"
|
|
tls = true # If `true` then it will use settings in `client.transport.tls`
|
|
|
|
[client.services.service1] # A service that needs forwarding. The name `service1` can change arbitrarily, as long as identical to the name in the server's configuration
|
|
type = "tcp" # Optional. The protocol that needs forwarding. Possible values: ["tcp", "udp"]. Default: "tcp"
|
|
token = "whatever" # Necessary if `client.default_token` not set
|
|
local_addr = "127.0.0.1:1081" # Necessary. The address of the service that needs to be forwarded
|
|
nodelay = true # Optional. Determine whether to enable TCP_NODELAY for data transmission, if applicable, to improve the latency but decrease the bandwidth. Default: true
|
|
retry_interval = 1 # Optional. The interval between retry to connect to the server. Default: inherits the global config
|
|
|
|
[client.services.service2] # Multiple services can be defined
|
|
local_addr = "127.0.0.1:1082"
|
|
|
|
[server]
|
|
bind_addr = "0.0.0.0:2333" # Necessary. The address that the server listens for clients. Generally only the port needs to be change.
|
|
default_token = "default_token_if_not_specify" # Optional
|
|
heartbeat_interval = 30 # Optional. The interval between two application-layer heartbeat. Set to 0 to disable sending heartbeat. Default: 30 seconds
|
|
|
|
[server.transport] # Same as `[client.transport]`
|
|
type = "tcp"
|
|
|
|
[server.transport.tcp] # Same as the client
|
|
nodelay = true
|
|
keepalive_secs = 20
|
|
keepalive_interval = 8
|
|
|
|
[server.transport.tls] # Necessary if `type` is "tls"
|
|
pkcs12 = "identify.pfx" # Necessary. pkcs12 file of server's certificate and private key
|
|
pkcs12_password = "password" # Necessary. Password of the pkcs12 file
|
|
|
|
[server.transport.noise] # Same as `[client.transport.noise]`
|
|
pattern = "Noise_NK_25519_ChaChaPoly_BLAKE2s"
|
|
local_private_key = "key_encoded_in_base64"
|
|
remote_public_key = "key_encoded_in_base64"
|
|
|
|
[server.transport.websocket] # Necessary if `type` is "websocket"
|
|
tls = true # If `true` then it will use settings in `server.transport.tls`
|
|
|
|
[server.services.service1] # The service name must be identical to the client side
|
|
type = "tcp" # Optional. Same as the client `[client.services.X.type]
|
|
token = "whatever" # Necessary if `server.default_token` not set
|
|
bind_addr = "0.0.0.0:8081" # Necessary. The address of the service is exposed at. Generally only the port needs to be change.
|
|
nodelay = true # Optional. Same as the client
|
|
|
|
[server.services.service2]
|
|
bind_addr = "0.0.0.1:8082" |