li-clutter-org / loadimpact-chrome-extension

Load Impact User Scenario Recorder Chrome Extension
https://chrome.google.com/webstore/detail/load-impact-user-scenario/comniomddgkfgfaebhidfgcjgoecbbda
Apache License 2.0
5 stars 1 forks source link

Websocket #2

Open millergarym opened 6 years ago

millergarym commented 6 years ago

The extension doesn't record websocket traffic.

robingustafsson commented 6 years ago

@millergarym The recorder in it's current form only supports outputting a Lua script for our current cloud service at loadimpact.com, and it unfortunately doesn't support WebSocket.

Our new open source load generator based on JavaScript, k6, however does support WebSocket (see https://docs.k6.io/docs/websockets). For k6 we don't have a dedicated recorder but it supports converting HAR files (from dev console browser recordings) to k6 JS scripts (see https://docs.k6.io/docs/session-recording-har-support).

millergarym commented 6 years ago

@robingustafsson unfortunately websocket traffic is not recorded in the HAR file and is not supported by the current har spec.

Is a K6 recorded in the works as I'm happy to contribute (time and skills permitting)

https://stackoverflow.com/questions/29953531/how-to-save-websocket-frames-in-chrome https://groups.google.com/forum/#!topic/google-chrome-developer-tools/jUOLFqpu-2Y https://groups.google.com/forum/#!topic/http-archive-specification/_DBaSKch_-s

robingustafsson commented 6 years ago

@millergarym Hm, that's true. At the moment we don't have a dedicated recorder started for k6. We only have this Chrome extension to record HTTP traffic and convert it to Lua, and a plugin for the Fiddler proxy (https://github.com/loadimpact/FiddlerToLoadImpact) that could perhaps be extended to extract WebSocket traffic as Fiddler supports that.

Found an alternative SO page talking about websocket interception from Chrome extension as well: https://stackoverflow.com/questions/22868897/access-websocket-traffic-from-chrome-extension, and it links to https://github.com/gorhill/chromium-websocket-wrapper. So it seems there exists ways to get at the WebSocket traffic from a Chrome extension, so maybe this Chrome extension could be extended to support WebSockets.

minddazed commented 5 years ago

Chromium now supports exporting websocket messages to HAR files. https://chromium.googlesource.com/chromium/src.git/+/9683677526bf8e4b9f87e52c1387da551078b0e4