Last active
June 1, 2022 12:05
-
-
Save polarnik/0408cf8a4e9916c4308b8c31b10d9aaf to your computer and use it in GitHub Desktop.
Fiddler 4 Classic. WebSocket test Generator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://www.telerik.com/blogs/what-s-new-in-fiddler-2-4-4-5 | |
public static void Main() { | |
// ... | |
FiddlerApplication.UI | |
.RegisterCustomHotkey( | |
HotkeyModifiers.Alt, | |
Keys.G, | |
"Generate" | |
); | |
// ... | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static bool OnExecAction(string[] sParams) { | |
// ... | |
case "Generate": | |
doGenerateCode(); | |
return true; | |
// ... | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void doGenerateCode() { | |
var arrS = FiddlerApplication.UI.GetSelectedSessions(); | |
for (int x = 0; x < arrS.Length; x++) { | |
var session = arrS[x]; | |
if (session.isFlagSet(SessionFlags.IsWebSocketTunnel)) { | |
var headers = session.oRequest.headers; | |
if( headers.Get("wsFrom")=="Client" | |
&& headers.Get("wsFrameType")=="Text" | |
//&& ... | |
) { | |
// ... generation | |
// file.append("ws.send(\"" + headers.Get("wsPayload") + "\");" ); | |
// ... generation | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment