rocky icon indicating copy to clipboard operation
rocky copied to clipboard

websocket middleware usage and examples needed, eg sniffing

Open nqzero opened this issue 7 years ago • 2 comments

the readme mentions that websocket middleware can be called with rocky.useWs() but there isn't an example of doing anything useful (the example just calls next())

i'm trying to use rocky to log websocket messages

using nodejitsu's http-proxy (which i believe rocky is built on top of) i've used socket.on("data") during the upgrade to run a handler, but the data appears to be in a binary format. i'd like to be able to access the underlying text stream that i see in the client using devtools

using rocky, i haven't even gotten this far (i'm getting socket hang up errors). however, looking through the source i don't see any logic that appears to decode the binary stream. so i'm not spending effort to debug my rocky usage until i determine if the middleware support is truly middleware

does rocky support this usage ?

the use of "websocket middleware" suggests that it can. if not, the readme should be updated

side question ... if rocky can't do this, could you suggest another technique or tool to achieve my goal

nqzero avatar Jul 03 '17 17:07 nqzero

+1

Exactly the same problem. Also tried http-proxy package with the same outcome

victorbucutea avatar Aug 01 '17 10:08 victorbucutea

is this still an issue? i am just seeing a connection error

maikelmclauflin avatar Sep 12 '21 03:09 maikelmclauflin