How to Use WebSocket Proxy Testing Tool

A comprehensive guide to help you get the most out of our WebSocket Proxy Testing Tool.

Getting Started

1. Install Extension

Install our Chrome extension from the Chrome Web Store to start testing WebSocket connections.

2. Open WebSocket Proxy Tool

  1. Open DevTools
  2. Select the WebSocket Proxy tab
  3. If it's not visible, check the ">>" menu

Monitoring WebSocket Traffic

Real-time Traffic Monitor

  • View all WebSocket connections
  • Inspect message contents
  • Track connection status

Using the Monitor

  1. Open the WebSocket Proxy panel
  2. Select a connection from the connections list
  3. View real-time messages in the traffic panel
  4. Click on messages to view detailed information

Modifying Messages

Message Transformation

  • Intercept messages
  • Modify payload data
  • Add custom parameters
  • Test error scenarios

Creating Modification Rules

  1. Click on the "CodeEditor" on the right side.
  2. Write your modification code.
  3. Use the target and message variables available in the JavaScript context to modify the message.
  4. Click the Run button to apply your code and execute it before each message is sent.

Example Modification

// Use the target variable to apply modifications for specific roles
if (target.startsWith("wss://irc-ws.chat.twitch.tv")) {
  const name = "justinfan000123456";
  
  // Modify the message
  if (message.startsWith("NICK")) {
    message = `NICK ${name}`;
  } else if (message.startsWith("USER")) {
    message = `USER ${name} 8 * :${name}`;
  }

  // Return the updated message
  return message;
}

Example JSON Modification

// Use the target variable to apply modifications for specific roles
if (target.startsWith("wss://hermes.twitch.tv")) {
  const parsedMessage = JSON.parse(message);
  
  // Modify the parsed message
  parsedMessage.category = "PubsubClient";
  parsedMessage.message = "flushing queued requests";
  parsedMessage.package = "@twitch/chat-pubsub-client";
  
  // Return the updated message, ensuring it's stringified back
  return JSON.stringify(parsedMessage);
}

Security Testing

Security Features

  • Test authentication
  • Verify encryption
  • Check access control

Security Best Practices

  • Always test in a controlled environment
  • Use secure WebSocket connections (wss://)
  • Implement proper authentication
  • Validate all message data

Next Steps

Now that you know the basics, learn more about specific testing scenarios: