Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

websocket-ping

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

websocket-ping

Small package to connect to and then send ping message to a websocket endpoint. Used for a quick test of ws servers.

  • 1.0.1
  • PyPI
  • Socket score

Maintainers
1

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!


FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc