Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Read websocket communication via userscript

How can a greasemonkey script / Chrome's user-script intercept a running websocket communication?

My goal is to have additional statistics for a in-browser game

like image 904
Vojtech B Avatar asked Jan 01 '17 21:01

Vojtech B


People also ask

How do I read WebSocket data?

First, you need to copy your web browser's header to here and use json. dumps to convert it into the string format. After that, create the connection to the server by using create_connection . Then, perform the handshake by sending the message, and you will be able to see the data on your side.

How do I open a WebSocket connection?

To open a websocket connection, we need to create new WebSocket using the special protocol ws in the url: let socket = new WebSocket("ws://javascript.info"); There's also encrypted wss:// protocol. It's like HTTPS for websockets.

What is the difference between WS and WSS?

The wss protocol establishes a WebSocket over an encrypted TLS connection, while the ws protocol uses an unencrypted connection. At this point, the network connection remains open and can be used to send WebSocket messages in either direction.

Is Node js good for WebSockets?

Node. js can maintain many hundreds of WebSockets connections simultaneously. WebSockets on the server can become complicated as the connection upgrade from HTTP to WebSockets requires handling. This is why developers commonly use a library to manage this for them.


1 Answers

You may use Firefox, then add the Firebug module then add & use websocket-monitor module to monitor websocket.

If you want to hook websocket from javascript you may also use wshook.

like image 182
A STEFANI Avatar answered Oct 08 '22 10:10

A STEFANI