Sign inSign up

minihaha/websocket-test

By minihaha

•Updated about 1 year ago

Image
Networking
0

758

minihaha/websocket-test repository overview

⁠WebSocket Test Service

A comprehensive WebSocket testing service with health checks, message echo, and broadcast functionality. Perfect for WebSocket development, testing, and debugging.

⁠Features

  • ✅ Dual WebSocket endpoints (standalone + HTTP)
  • 🔧 Smart message handling (JSON objects + plain text)
  • 📊 Built-in health check endpoint
  • 📢 Broadcast messaging to all connected clients
  • 🐛 Fixed numeric input handling (no more disconnections)
  • 📝 Comprehensive logging

⁠Quick Start

docker run -d -p 8080:8080 -p 8765:8765 --name websocket-service minihaha/websocket-test:latest

⁠Endpoints

  • Health Check: http://localhost:8080/
  • HTTP WebSocket: ws://localhost:8080/ws
  • Standalone WebSocket: ws://localhost:8765/

⁠Test with wscat

# Install wscat
npm install -g wscat

# Connect and test
wscat --connect ws://localhost:8765
> hello world
> {"type": "ping", "data": "test"}
> 123

⁠Message Types

  • Plain text: Echoed with metadata
  • JSON ping: Returns pong response
  • JSON echo: Returns original message
  • JSON broadcast: Sends to all connected clients

Perfect for testing WebSocket connections, debugging real-time applications, and monitoring WebSocket infrastructure.

Issues fixed: Numeric input no longer causes disconnections.


GitHub: jordan13p/websocket-test⁠

Tag summary

Content type

Image

Digest

sha256:6c735b912…

Size

56.2 MB

Last updated

about 1 year ago

docker pull minihaha/websocket-test