This is a simple WebSocket test server designed for testing connections and latency.
How it works:
- The tester can connect to either the Twitch IRC WebSocket server or a custom WebSocket server (for example, an echo test server).
- The server to test can be chosen by passing an argument when running the script (default: "custom").
- Once connected, the tester will send 5 test PINGs to the chosen server:
- For Custom servers: sends a PING message and waits for the PONG response to measure RTT (Round-Trip Time).
- For Twitch: sends a PING :tmi.twitch.tv and measures the time until the PONG response is received from the Twitch server.
Logging:
- All sent and received messages, including timestamps and RTTs (in milliseconds), are logged.
- After 5 successful ping cycles, a log file is automatically created in the "logs" folder, containing all relevant details.
- The program will display the log file path for 3 seconds and then exit automatically.
Instructions:
- Start the test by running "start.bat" and choose the server by passing either "twitch" or "custom" as an argument.
- Make sure you have network connectivity to the selected WebSocket server.
This tester is intended purely for development and testing purposes and does not interact with Twitch chat beyond the PING/PONG messages.
-
Install Node.js:
- Download and install Node.js from https://nodejs.org/
- Verify installation by running
node -vandnpm -vin the terminal.
-
Clone or download this repository:
- Open a terminal in the project folder.
-
Install dependencies:
- Run
npm installto install the required packages (WebSocket, etc.). - The provided package.json ensures all dependencies are installed correctly.
- Run
-
Run the tester with the "start.bat" file (change settings in it first):
- Default (Twitch):
node index.js twitch channelname - Custom server:
node index.js custom
- Default (Twitch):
-
Logs:
- After 5 test pings, a log file will be created automatically in the
logsfolder. - The program will display the log file path for 3 seconds before exiting.
- After 5 test pings, a log file will be created automatically in the
Notes:
- Ensure you have an active internet connection for the chosen server.
- This tester is intended for development and testing purposes only.
This WebSocket tester provides a simple and effective way to verify WebSocket connectivity and measure response times for both Twitch and custom servers. All activities are logged in detail, including timestamps and RTTs, making it easy to review performance or diagnose connection issues.
Thank you for using this tester! We hope it helps you quickly and reliably test your WebSocket servers. Feedback, improvements, or contributions are always welcome. Happy testing!