Small package to connect to and then send ping message to a websocket endpoint. Used for a quick test of ws servers.
Project description
ping_ws.py usage
setup
To install pip package
pip install websocket-ping
For dev version
python -m venv .venv
source .venv/bin/activate
pip install -r requirements_ws_ping.txt
cli interface
-w flag is for the websocket endpoint -d is the duration to test if the connection is maintained (in seconds)
python -m ping_ws.ping_ws -w wss://host/ws/ping/ -d [int]
examples
# Failure to connect - server rejecting connection
(.venv) $ python -m ping_ws.ping_ws -w wss://host/ws/ping/
Connection to wss unsuccessful: server rejected WebSocket connection: HTTP 502
# Success on connection
(.venv) $ python -m ping_ws.ping_ws -w ws://localhost:8000/ws/ping/
Successfully connected to ws://localhost:8000/ws/ping/, response to ping: pong
Maintained connection to ws://localhost:8000/ws/ping/, response to ping: pong
Success!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
websocket_ping-1.0.1.tar.gz
(2.9 kB
view hashes)
Built Distribution
Close
Hashes for websocket_ping-1.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cba37aa6749eabb5b6d3be782befe27426cd7d25c32660a17c3a782073474e54 |
|
MD5 | f5e30a22fd4fef7ff61d1a0a6c6a692a |
|
BLAKE2b-256 | 58ac2f4a11d607c872590774d3e41d831d07a2c93b126b3811a5dd7b8855abbd |