DarkShield / daProxy

Proxy boxes
0 stars 0 forks source link

Handle WebSockets #53

Open mattjay opened 10 years ago

mattjay commented 10 years ago

Learn how to proxy and inspect web socket traffic.

mattjay commented 10 years ago

I believe 77c1523c257306d2a61a78f02907c6b1b7774105 handles this. Need to figure out how to write a test for it though.

mattjay commented 10 years ago

Possible testing resource: http://stackoverflow.com/questions/15509231/unit-testing-node-js-and-websockets-socket-io

mattjay commented 10 years ago

Can see how http-proxy is testing their web socket inbound here: https://github.com/nodejitsu/node-http-proxy/blob/master/test/lib-http-proxy-passes-ws-incoming-test.js

They have an interesting setup with there "passes" folder with some custom APIs that seem to make it a bit more flexible for testing. I.e. - "checkMethodAndHeader" as seen in that test.

they are just testing to see if the socket gets destroyed or not. I think we'd want to follow with our current setup of testing the proxy, but we might want to seek alternatives than relying on things like Urban Hydro being up in order for our tests to pass.