Local throttling proxy for testing apps under degraded network conditions.
Project description
NetShape
NetShape runs desktop apps through a local SOCKS5-capable throttling proxy so developers can test degraded network conditions without OS-level network rules or administrator privileges.
This repository is being rebuilt incrementally from the proxy-based architecture plan.
Development
python -m pip install -e ".[dev]"
python -m netshape --version
Usage
List the built-in network profiles:
netshape profiles
Run an app through the local proxy:
netshape run --profile 3g -- python -c "print('hello')"
While a session is active, use another terminal to inspect or adjust it:
netshape status
netshape adjust --latency 500ms
netshape stop
Automatically stop a long-running session:
netshape run --profile 3g --timeout 30m -- your-app-command
Verify that the proxy can handle traffic:
netshape test --profile 3g
NetShape sets ALL_PROXY=socks5://127.0.0.1:<port> for launched apps so SOCKS-aware runtimes such as Electron/Chromium can route raw TCP through the proxy. The same traffic port also still accepts HTTP proxy requests and HTTPS CONNECT tunnels for compatibility.
NetShape uses one shared bidirectional bandwidth bucket for each proxy session, so upload and download traffic compete for the configured capacity like a constrained network link. SOCKS5 UDP ASSOCIATE is not implemented yet.
The bundled profiles are a curated mix of mobile, broadband, and constrained-network presets. They intentionally diverge from the earlier mobile-only product spec so local desktop app testing can cover Wi-Fi, DSL, cable, fiber, satellite, and congested links too.
Testing
Run the automated suite:
python -m pytest
Quick CLI smoke checks:
python -m netshape --version
python -m netshape status --json
python -m netshape run --port 0 --profile 3g -- python -c "print('ok')"
python -m netshape test --profile 3g --bytes 1024
Manual proxy smoke test with real HTTP traffic:
netshape run --profile 3g -- curl http://example.com
For desktop apps, launch the app command after --; Electron and most CLI tools inherit ALL_PROXY, HTTP_PROXY, and HTTPS_PROXY from the NetShape session.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file netshape-1.0.0.tar.gz.
File metadata
- Download URL: netshape-1.0.0.tar.gz
- Upload date:
- Size: 63.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8524c6de88a82eda8c943a823ec54c963b87dd23561172273506f9d4821dfd95
|
|
| MD5 |
4c83277e9b82094590c4efb2a1a46799
|
|
| BLAKE2b-256 |
c1da371af7a8b91cc3a7775a9ab41f1b5b352cc11b0c44621f49988cfe2e81cc
|
Provenance
The following attestation bundles were made for netshape-1.0.0.tar.gz:
Publisher:
publish.yml on aarush-dhingra/netshape
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
netshape-1.0.0.tar.gz -
Subject digest:
8524c6de88a82eda8c943a823ec54c963b87dd23561172273506f9d4821dfd95 - Sigstore transparency entry: 1740538490
- Sigstore integration time:
-
Permalink:
aarush-dhingra/netshape@ceb119fcb815b3afa864941f8624d8671825ab1e -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/aarush-dhingra
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@ceb119fcb815b3afa864941f8624d8671825ab1e -
Trigger Event:
release
-
Statement type:
File details
Details for the file netshape-1.0.0-py3-none-any.whl.
File metadata
- Download URL: netshape-1.0.0-py3-none-any.whl
- Upload date:
- Size: 56.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6acd8c2d051acb7c46cf501dbcc9ad5b9b8f01dc8e000758bb88ce38b017d8a3
|
|
| MD5 |
43bc89de7556dff405a2c9a3c3d6dbae
|
|
| BLAKE2b-256 |
7ae932eca3e0bdf3693c631cfb4905f9594a7b33a020d960bef9518a4aec656a
|
Provenance
The following attestation bundles were made for netshape-1.0.0-py3-none-any.whl:
Publisher:
publish.yml on aarush-dhingra/netshape
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
netshape-1.0.0-py3-none-any.whl -
Subject digest:
6acd8c2d051acb7c46cf501dbcc9ad5b9b8f01dc8e000758bb88ce38b017d8a3 - Sigstore transparency entry: 1740538520
- Sigstore integration time:
-
Permalink:
aarush-dhingra/netshape@ceb119fcb815b3afa864941f8624d8671825ab1e -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/aarush-dhingra
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@ceb119fcb815b3afa864941f8624d8671825ab1e -
Trigger Event:
release
-
Statement type: