This is a migrated thread and some comments may be shown as answers.

Add Websocket Message Inspector?

7 Answers 781 Views
Extensions and Customization
This is a migrated thread and some comments may be shown as answers.
Jim
Top achievements
Rank 1
Jim asked on 01 Feb 2016, 07:48 PM

I'd like to be able to decode/inspect websocket messages (messages are 20-byte binary) so that each message can appear in a human readable way.  We basically just want to extend/add a custom websocket inspector which will show the selected message after it's been custom "decoded".  I have purchased Debugging with Fiddler Second Edition, but don't see any guidance for implementing a custom Websockets inspector.

Any guidance would be greatly appreciated!

Thanks!

Jim

7 Answers, 1 is accepted

Sort by
0
Tsviatko Yovtchev
Telerik team
answered on 04 Feb 2016, 02:09 PM
Hi,

For the time being you could use the "Inspect as Response" button in the WebSocket tab to send the message to the Web Sessions list. There you could inspect it with a custom inspector.

Regards,
Tsviatko Yovtchev
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
EricLaw
Top achievements
Rank 1
answered on 04 Feb 2016, 04:41 PM

Howdy, Jim! Thanks for your support of my book! This new topic isn't in the current edition of the book, but it will be covered in the next update to the ebook. 

To enable your extension to view WebSocket traffic, write an inspector which implements the IResponseInspector2 and IWSMInspector interfaces. This latter interface has one method, AssignMessage(WebSocketMessage oWSM); your code should inspect the message when this method is called. 

0
Peter
Top achievements
Rank 1
answered on 24 Apr 2019, 05:53 AM
Is there a way to inspect all of the websocket message in a given connection as a whole, i.e. to receive notifications of each message as it comes in, instead of as a response to the user selecting an individual message? Thanks!
0
Simeon
Telerik team
answered on 30 Apr 2019, 08:52 AM
Hello Peter,

You could add the OnWebSocketMessage function in your script.
static function OnWebSocketMessage(webSocketMessage: WebSocketMessage) {
    FiddlerApplication.Log.LogString(webSocketMessage.ToString());
}

Regards,
Simeon
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Peter
Top achievements
Rank 1
answered on 30 Apr 2019, 07:14 PM
Thanks Simeon - I'd like to do this in the context of an Inspector, though, if possible.
0
Peter
Top achievements
Rank 1
answered on 01 May 2019, 11:12 PM
And a related question - I wrote an inspector that implements IWSMInspector to at least be able to analyze individual WebSocket messages at a time. However, I am not seeing IWSMInspector::AssignMessage being invoked on 2 of my 3 machines where I've tried this. They are all running the same version of Fiddler (v5.0.20182.28034). The inspector UI is otherwise loading and displaying just fine; it's just that it never receives AssignMessage notifications when WS messages are selected. On the one machine where it's working, it's working great. Any ideas?
0
Simeon
Telerik team
answered on 03 May 2019, 02:40 PM
Hi Peter,

This is a strange behavior. I understand that you are using the Fiddler version 5.0.20182.28034 on all 3 machines. I would like to ask if there are any differences between the machines: Windows versions and builds installed and/or .NET Framework versions installed.

Could you, please, provide us with the source code of the inspector or its binnary or a minimalistic version of it which reproduces this behavior, if possible, so I could investigate further.

Thanks and Regards,
Simeon
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Extensions and Customization
Asked by
Jim
Top achievements
Rank 1
Answers by
Tsviatko Yovtchev
Telerik team
EricLaw
Top achievements
Rank 1
Peter
Top achievements
Rank 1
Simeon
Telerik team
Share this question
or