A lightweight WebSocket proxy server written in Python 3.
| Mode | Description |
|---|---|
OPEN_URL |
Client specifies the upstream URL to connect to |
FORCED_URL |
Server is hardwired to one upstream URL; client must authenticate |
FORCED_URL_NO_PASSWORD |
Server is hardwired to one upstream URL; no authentication required |
- Python 3.9+
pip install -r requirements.txtEdit config.yaml before starting the server:
configuration:
authenticationConfiguration:
password: "yourpassword"
serverConfiguration:
type: "FORCED_URL_NO_PASSWORD" # OPEN_URL | FORCED_URL | FORCED_URL_NO_PASSWORD
listenHost: "localhost"
port: "1111"
requestsPerConnection: "10000"
proxiedUrl: "ws://localhost:9001" # required for FORCED_URL and FORCED_URL_NO_PASSWORD
transportConfiguration:
sendPrefix: ""
sendSuffix: ""python3 launch.pyOnce connected, the exchange depends on the server mode.
→ {"password": "yourpassword"}
← {"status": "ok", "message": "..."}→ {"url": "ws://upstream-host:port/path"}
← {"status": "ok", "message": "..."}→ "your message"
← "proxied response"→ {"action": "close"}All error responses have the form {"status": "error", "message": "..."}.
python3 -m unittest test.proxy_tests test.loggers_tests -v