Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to debug websockets with wireshark

Tags:

I have hosted my websocket server using python tornado server on localhost ws://localhost:8001 and client is on another system on 192.168.0.116 so when we try to communicate it works fine but cant debug it using wireshark. My websocket is running on port 8001 so i tried using

tcp.port==8001 

but no result found so i then tried it on http my ip in lan is 192.168.0.219 and port 8001. so

http.host == 192.168.0.219 && tcp.port == 8001 

but no results found. Is there anything else that i can try to debug my websocket.

like image 990
Hitul Mistry Avatar asked Sep 29 '12 05:09

Hitul Mistry


People also ask

Can Wireshark capture WebSocket?

The Wireshark dissector is fully functional with WebSocket protocol.

How do I capture 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.


2 Answers

You can also filter to show only WebSocket packets by using a display filter:

(websocket) 
like image 144
Drew Noakes Avatar answered Sep 24 '22 11:09

Drew Noakes


Finally i found it.

When i put

tcp.dstport == 8001 || tcp.srcport == 8001 

At that time i can capture it.

like image 32
Hitul Mistry Avatar answered Sep 21 '22 11:09

Hitul Mistry