Simple backend component to control parallel requests.
The main use case for this component is to impose limits on parallel requests when using multiple web servers for horizontal scaling.
In order to compile the project, navigate to the server folder and run the Golang compiler:
go build .
The build command will create a binary in the current directory, called server
, or server.exe
if you are using Windows.
You can find the docker image for this project available in Docker Hub: https://hub.docker.com/r/asanrom/parallel-request-controller
To pull it type:
docker pull asanrom/parallel-request-controller
You can configure the server using environment variables. You can set up a .env
file in the current working directory in order to set them in an easy way.
Here is a list with all the available configuration variables for the server.
Variable | Description |
---|---|
PORT |
The listening port for the server. By default: 8080 |
BIND_ADDRESS |
Bind address for the server. By default it binds to all network interfaces. |
AUTH_TOKEN |
Authentication token the clients must send in order to connect to the server. |
Variable | Description |
---|---|
TLS_ENABLED |
Can be YES or NO . If YES , TLS will be enabled for the server, and client must connect with the wss: protocol. |
TLS_CERTIFICATE |
Path to the certificate file to load (PEM format). |
TLS_PRIVATE_KEY |
Path to the private key file to load (PEM format). |
Variable | Description |
---|---|
LOG_INFO |
Can be YES or NO . If YES , it will log information messages to the standard output. Default: YES |
LOG_DEBUG |
Bind address for the server. By default it binds to all network interfaces. |
This project is under the MIT License.