Skip to main content

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

netshape-0.1.0.tar.gz (58.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

netshape-0.1.0-py3-none-any.whl (50.8 kB view details)

Uploaded Python 3

File details

Details for the file netshape-0.1.0.tar.gz.

File metadata

  • Download URL: netshape-0.1.0.tar.gz
  • Upload date:
  • Size: 58.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for netshape-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b77df9f776d8c4648624d55d27210db8f6015d03993be7135eec6fbd24a61367
MD5 d28b71fc90803185d5ff7f93c32461d6
BLAKE2b-256 837a7b4a0a66e7c965e47a5808fb6da1f2c573ab7be83a5867990ef16d2d28a6

See more details on using hashes here.

Provenance

The following attestation bundles were made for netshape-0.1.0.tar.gz:

Publisher: publish.yml on aarush-dhingra/netshape

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file netshape-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: netshape-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 50.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for netshape-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d811d979c07c478dc138c4dd48dc161b6495ee1ef22bfdee6f5ac47619fa9e36
MD5 f16df7ad5ae88f5b0b4a2663e6755973
BLAKE2b-256 1aca704962dcf3b319b292788c665bded7a79239f42255aa806609f2beb14f1d

See more details on using hashes here.

Provenance

The following attestation bundles were made for netshape-0.1.0-py3-none-any.whl:

Publisher: publish.yml on aarush-dhingra/netshape

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page