Command Line¶
GOST currently has the following command line options:
-L
- Specify service. You can set multiple services.
The value of this parameter is in URL-like format (the content in square brackets can be omitted):
For port forwarding mode
scheme
-
It can be a combination of a handler and a listener, or a single handler (the listener defaults to tcp) or a listener (the handler defaults to auto), for example:
http+tls
- The combination of the http handler and the tls listener specifies the HTTPS proxy service.http
- Equivalent tohttp+tcp
, the combination of the handler http and the listener tcp, specifies the HTTP proxy service.tcp
- Equivalent totcp+tcp
, a combination of handler tcp and listener tcp, specifies TCP port forwarding.tls
- Equivalent toauto+tls
, a combination of handler auto and listener tls.
Example
Address List
Port forwarding mode supports the following forwarding target address list format:
-F
- Specify a forwarding node. You can set multiple nodes to form a forwarding chain.
This parameter value is in URL-like format (the content in square brackets can be omitted).
scheme
-
It can be a combination of a connector and a dialer, or a single connector (the default for the dialer is tcp) or a dialer (the default for the connector is http), for example:
http+tls
- A combination of connector http and dialer tls, specifying the HTTPS proxy node.http
- Equivalent tohttp+tcp
, a combination of the handler http and the listener tcp, specifying the HTTP proxy node.tls
- Equivalent tohttp+tls
.
Example
Node Group
You can also form a node group by setting an address list:
-C
- Specifies an external configuration file.
-O
- Specify the configuration output format, currently supportsyaml
orjson
.
Example
Output yaml format configuration:
Output json format configuration:
Convert json format configuration to yaml format:
-D
- Enable Debug mode for more detailed log output.
**
-DD
- Enable Trace mode to output more detailed log information than Debug mode.
-V
- Print version.
-api
- Specify the web API address.
-metrics
- Specify prometheus metrics API address.
Handle special characters in command line scheme
Zsh in macOS does not support ?
and &
, you have to use ""
to quote them,otherwise you'll get warnings in Terminal: "zsh: no matches found: ..."。