-
Notifications
You must be signed in to change notification settings - Fork 616
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support websockets #9
Comments
Added support for transparent websocket proxying. Works for my simple client but could use some real-world testing. |
* Add websocket support to demo/server * Add simple websocket client in demo/wsclient
I've added experimental websocket support. See documentation https://github.com/eBay/fabio#websockets. I call it experimental since I don't have an in-house use case to test this beyond a simple test client which is included in the code base. Please test and file issues if something is broken. |
Thank you adding suppport for websockets. Before I stress test the current state, I like to share with you a snippet I got from Brad Fritzpatrick (see go-nuts link) which it more compact and appearantly does not require the websockets package.
|
The only caveat I can think of is that this is no longer an application level gateway. With this code you don't know whether you're actually forwarding websocket data since you're forwarding whatever goes over the wire. The current implementation will forward the messages only having properly terminated the WS messages. That has benefits and downsides. Need to think about it. |
Tested the code above and it works. I'll do the error checking slightly different to make sure you don't end up with a dangling TCP connection. The benefits are one dependency less and independence of the websocket protocol version. The downside is that after the the initial handshake a malicious client can throw whatever traffic at the server. Opinions? |
In the process I've learned about Request.Write 😃 |
I've added the raw websocket handler for testing but left it disabled. See I'm still leaning towards the filtered WS handler unless there is a performance and/or compatibility issue. |
Looks like there are some compatibility issues with the WS proxy that uses the library. I'll make the raw WS proxy the default in 1.0.6. |
Merged raw websocket proxy to master as the default. |
Some people have been asking about websocket support for fabio. I think it shouldn't be too hard to add but I need to see when I can get to it. Keeping this as a placeholder so that I don't forget.
The text was updated successfully, but these errors were encountered: