h2non / rocky

Full-featured, middleware-oriented, programmatic HTTP and WebSocket proxy for node.js (deprecated)
MIT License
371 stars 24 forks source link

websocket middleware usage and examples needed, eg sniffing #110

Open nqzero opened 7 years ago

nqzero commented 7 years ago

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

victorbucutea commented 7 years ago

+1

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

maikelmclauflin commented 3 years ago

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