Skip to content

Backend component to control parallel requests, allowing for limits to be imposed in a multi-server environment.

License

Notifications You must be signed in to change notification settings

AgustinSRG/parallel-request-controller

Repository files navigation

Parallel Request Controller

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.

Compilation

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.

Docker Image

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

Server configuration

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.

General

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.

TLS

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).

Logs

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.

Clients

Documentation

License

This project is under the MIT License.