In the front-end page development, you can use the tools such as Charles, Fiddler, and so on to mock the HTTP request in the page, but the mock of the WebSocket request is helpless. This article shows a tool that can intercept websocket requests in a page and send custom data to intercepted WebSocket.
First step: Create a new debugging session in the Debug dialog box. In the following illustration, the new debugging session intercepts the WebSocket link containing the ' Taobao ' string.
The second step is to open the console in the first page of Taobao, create a new WS connection to Wss://taobao.com/mock/test://www, and bind the event response function
At this point, the Debug dialog prompts you to establish a debugging connection.
The third step, in the Debug dialog box to send a message, Taobao homepage of the console will output the message from the dialog box.
The fourth step, Taobao issued the WS message, will be intercepted sent to the Debugging dialog box