Disclosure Statement: This site contains affiliate links, which means that I may receive a commission if you make a purchase using these links. As an eBay Partner, I earn from qualifying purchases.

Intercept Websocket messages

Post Reply
darkducke
Posts: 21
Joined: Thu Feb 15, 2018 4:29 pm

Intercept Websocket messages

Post by darkducke »

Hello, I access a page that opens a connection with a websocket and sends and receives messages, using the devtools of the MiniBrowser example, I can see these messages by selecting the websocket url, and in the "Messages" tab next to the "Headers" tab, my The question is, how to intercept these messages through Chromium? the websocket connection url wss://xxx... does not appear in LoadEnd, is there any event that allows me to obtain this url?

Thanks in advance!
User avatar
salvadordf
Posts: 4057
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Intercept Websocket messages

Post by salvadordf »

Hi,

CEF doesn't expose any event to intercept webcokets but you can use the Network.webSocketFrameReceived DevTools method :
https://chromedevtools.github.io/devtools-protocol/tot/Network/#event-webSocketFrameReceived
darkducke
Posts: 21
Joined: Thu Feb 15, 2018 4:29 pm

Re: Intercept Websocket messages

Post by darkducke »

Thanks for the way, I managed to get the data by opening a WebSocket connection with devtools!

:D
Post Reply