Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shubham1172/golim
Rate-limited proxy server in Go
https://github.com/shubham1172/golim
go proxy throttling
Last synced: about 1 month ago
JSON representation
Rate-limited proxy server in Go
- Host: GitHub
- URL: https://github.com/shubham1172/golim
- Owner: shubham1172
- License: apache-2.0
- Created: 2021-07-21T11:50:55.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-02-05T11:28:38.000Z (almost 3 years ago)
- Last Synced: 2024-10-20T23:47:31.671Z (2 months ago)
- Topics: go, proxy, throttling
- Language: Go
- Homepage:
- Size: 18.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Golim
Rate-limited proxy server in Go. This can be used in two ways
1. **When you are hosting a web server**. This can be used to protect your web server from huge traffic or DDOS attacks.
2. **When you are using someone's web server**. This can be used to make sure you don't cross the free API limit and get billed for more $$.# Usage
## Pull from DockerHub
The easiest way to use this is via the docker hub image. To start running golim on port 8080:
```sh
docker run --rm -p 8080:80 shubham1172/golim:latest -web-server-addr=http://192.168.0.12:8000
```## Build from source
Make sure to edit the environment variables in the docker-compose.yml file.
```sh
git clone https://github.com/shubham1172/golim
cd golim
docker-compose up
```# Configuration
Golim can be configured via the command line arguments or the environment variables. If both are specified, the command line arguments takes precedence.
| Command Line Argument | Environment Variable | Description |
|-|-|-|
| -web-server-addr | GOLIM_WEB_SERVER_ADDR | Address of the web server. |
| -rate-limiter-burst | GOLIM_RATE_LIMITER_BURST | Number of requests that can be made in a given time window. |
| -rate-limiter-window-seconds | GOLIM_RATE_LIMITER_WINDOW_SECONDS | Time window in seconds for which the burst is allowed. |