Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: 1 day 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 (11 days ago)
- Default Branch: main
- Last Pushed: 2025-02-02T18:02:34.000Z (2 days ago)
- Last Synced: 2025-02-02T19:18:54.868Z (2 days ago)
- Topics: linux, localhost, macos, macosx, network, python, redirect, redirection, throttle, throttling, unix, windows
- Language: Python
- Homepage:
- Size: 99.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[![Tests](https://github.com/CrafterKolyan/localhost-throttle/actions/workflows/tests.yml/badge.svg?branch=main)](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
```