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
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)
./ping_ws.py -w wss://host/ws/ping/ -d [int]
examples
# Failure to connect - server rejecting connection
(.venv) $ ./ping_ws.py -w wss://host/ws/ping/
Connection to wss unsuccessful: server rejected WebSocket connection: HTTP 502
# Success on connection
(.venv) $ ./ping_ws.py -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-0.0.1.tar.gz
(2.2 kB
view hashes)
Built Distribution
Close
Hashes for websocket_ping-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dd4b7eee136b97e04001e0ae51e06aaed0009baede54e34ce11e56cf77d72065 |
|
MD5 | 7e17d342abd71067cfa7a0d13df44a78 |
|
BLAKE2b-256 | 057d4778051a9cc4945ff08de49c42a4a590c37a86fe48b5792c5561e0584ff6 |