Load Balancing

Node Group

A node group consists of one or more nodes, each node can be any type. In GOST, each level of the proxy chain is a node group.

GOST added support for load balancing in version 2.5. Load balancing can be applied at all levels of the proxy chain.

There are two types of load balancing, here simply called simple and complex, the two types can be used in combination.


Simple type is similar to DNS load balancing, you can specify multiple addresses for the proxy node:

gost -L=:8080 -F='http://localhost:8080?ip=,,' -F=socks5://localhost:1080?ip=,,


ip - the actual proxy address(es) (a comma-separated list), the address format can be ip[:port] or hostname[:port], If no port is specified, the port in the URL is used by default.

strategy - (2.6+) Specify node selection strategy, round for round-robin, random for random selection, fifo for top-down selection, the default is round.

max_fails - (2.8.1+) The maximum number of failed connections for a specified node, When the number of failed connections with a node exceeds this set value, the node will be marked as a Dead node, Dead node will not be selected to use. default value is 1.

fail_timeout - (2.8.1+) Specify the dead node's timeout period. When a node is marked as a dead node, it will not be selected within this set time interval. After this set time interval, it will participate in node selection again.

When the ip parameter is set, the address specified in the URL will be ignored.

When the peer (see below) parameter is set, the options above will be overwritten.

The node selection strategy can be specified with the strategy parameter. Default value is round (NOTE: strategy parameter requires 2.6+ version).

figure 01

When more than one node is assigned to a level, GOST places the nodes in the same node group in the specified order.

Each time a client sends a request, the proxy chain first determines a path to perform node selection (random, round-robin or fifo) for each node group.

figure 02

After node selection, the command line is equivalent to:

gost -L=:8080 -F= -F=socks5://

If there are too many addresses, you can use the configuration file:

gost -L=:8080 -F=http://localhost:8080?ip=iplist1.txt -F=socks5://localhost:1080?ip=iplist2.txt

The configuration file format is a list of addresses separated by new-line:

The simple type requires that the type and configuration of all nodes at each level be consistent.


Complex type overcomes the limitations of the simple type and gives you the freedom to specify the type of node in each node group in the proxy chain.

figure 03

gost -L=:8080 -F=kcp:// -F=http2://

The client specifies additional node configuration file via the peer parameter. The configuration file format is:

# strategy for node selecting
strategy        random

max_fails       1

fail_timeout    30s

# period for live reloading
reload          10s

# peers
peer    http://:18080
peer    socks://:11080
peer    ss://chacha20:123456@:18338

Format description:

strategy - Same as the strategy option.

max_fails - Same as the max_fails option.

fail_timeout - Same as the fail_timeout option.

reload - This configuration file supports live reloading. This option specifies how often the file is checked for changes, and the live reloading is disabled by default.

peer - Specify the peer node list.

Each time a client sends a request, the proxy chain first determines a path to perform node selection (random or round-robin) for each node group.

figure 04

Simple + Complex

When used in combination, the proxy chain places all nodes specified at each level (via the ip and peer parameters) in the same node group and performs node selection (random or round-robin) on each node group, Finally determine a path:

figure 05

Full example configuration


    "Debug": false,
    "Retries": 3,
    "Routes": [
            "Retries": 3,
            "ServeNodes": [
            "ChainNodes": [


strategy        random
max_fails       1
fail_timeout    30s

reload          10s

# peers
peer    ss+kcp://aes-128-cfb:pass@[host]:port?ip=ips.txt