Forum Discussion
Narendra_26827
Nimbostratus
Jul 27, 2011Websocket failover by LB_FAILED
Hi,
We have an application which uses websockets to connect to the server from the client side.
Now in the iRule we have mentioned in HTTP_REQUEST event that for
websocket the HTT...
spark_86682
Jul 28, 2011Historic F5 Account
I don't know anything about websockets, or how they work, or why the HTTP filter interferes with them (which to me is scary and bad; are they using another dreaded almost-but-not-quite-HTTP protocol?), and I can't quite follow your question. I *think* you're trying to resstablish a websocket to a different server when the original server goes down.
Once you disable HTTP (I can't remember if this happens immediately when you call HTTP::disable, or after that event finishes), all the HTTP information (e.g. HTTP::uri, etc.) and commands (e.g. HTTP::retry) are unusable. So that approach won't work.
If you want to attempt this, I think you'll need to use the TCP:: commands. In LB_FAILED, set a flag and create a variable which contains whatever the websocket handshake/request/etc. looks like, and then if that flag is set in SERVER_CONNECTED you can use TCP::respond to send it to the server.
All that assumes that websockets use some sort of well-defined request-response protocol with a single request per connection. If not, you'll need to do something much more complicated involving parsing the websocket stream and buffering the last request, etc.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects