Service supports dynamic configuration via Web API.
Everything as a Service
In GOST, the client and the server are relative, and the client itself is also a service. If a forwarding chain or forwarder is used, the node in it is regarded as the server.
Service is the fundamental module of GOST and the entrance to the GOST program. Both the server and the client are built on the basis of services.
A service consists of a listener as a data channel, a handler for data processing and an optional forwarder for port forwarding.
When a service is running, the listener will listen on the specified port according to the configuration of the service and communicate using the specified protocol. After receiving the correct data, the listener establishes a data channel connection and hands this connection to the handler for use. The handler performs data communication according to the specified protocol, and after receiving the request from the client, obtains the target address. If a forwarder is used, the target address specified in the forwarder is used, and then the router is used to send the request to the target host.
Router is an abstract module inside the handler, which contains the forwarding chain, resolver, host mapper, etc., for request routing between the service and the target host.
In command line mode, if there is a forwarding chain, all services will use this forwarding chain by default. The
ignoreChain option allows specific services not to use the forwarding chain.
The HTTP service on port 8080 does not use the forwarding chain, and the SOCKS5 service on port 1080 uses the forwarding chain.
In the command line mode, all services run in the same process by default, use the
-- separator to make the service run in a separate process.
The above command will start three processes corresponding to three services, and the forwarding chain is only used by the service on port 1080.
Execute Commands (Linux Only)¶
postDown options can be used to execute additional commands before and after the service starts or stops.