https://github.com/crafterkolyan/localhost-throttle
Tool to throttle or redirect your network connections
https://github.com/crafterkolyan/localhost-throttle
linux localhost macos macosx network python redirect redirection throttle throttling unix windows
Last synced: 6 months ago
JSON representation
Tool to throttle or redirect your network connections
- Host: GitHub
- URL: https://github.com/crafterkolyan/localhost-throttle
- Owner: CrafterKolyan
- Created: 2025-01-24T21:28:06.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2025-03-09T11:31:29.000Z (7 months ago)
- Last Synced: 2025-03-28T20:13:32.993Z (7 months ago)
- Topics: linux, localhost, macos, macosx, network, python, redirect, redirection, throttle, throttling, unix, windows
- Language: Python
- Homepage:
- Size: 96.7 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[](https://github.com/CrafterKolyan/localhost-throttle/actions/workflows/tests.yml)
# localhost-throttle
Tool to throttle or redirect your network connections## Usage
```
localhost-throttle --server --new-server --protocols tcp,udp --bandwidth
```You should think about `localhost-throttle` as a wrapper around your server.
`server-address` means the original address on which the original server listens. Example: `localhost:8000`
`new-server-address` means the address to which `localhost-throttle` server will be binded. Example: `0.0.0.0:8001`## Example:
```
localhost-throttle --server localhost:8000 --new-server 0.0.0.0:8001 --protocols tcp --bandwidth 100000
```## Current features
- Redirection of TCP/UDP traffic from one port to another
- Basic TCP/UDP traffic bandwidth limitting (will be improved in the future)## Installing package
```
pip install .
```### Requirements
- Python 3.10+
- `setuptools>=42`
- `pip>=19`
- OS that supports threads## Development
### Setting up environment
```
python -m venv .venv
.venv\Scripts\activate.bat (for Windows)
.venv/Scripts/activate (for Unix)
pip install -U setuptools
python -m pip install -U pip
pip install -r requirements-dev.txt
```### Enabling environment
```
.venv\Scripts\activate.bat (for Windows)
.venv/Scripts/activate (for Unix)
```### Running tests
```
pytest test -n auto --capture=no
```
or
In VS Code: `Command Pallete` (Ctrl+Shift+P) -> `Tasks: Run Task` -> `Run tests`### Deactivating environment
```
.venv\Scripts\deactivate.bat
```