Is there any way to send a redirect in response to a websocket request?
d
dave
11/21/2022, 7:26 PM
Tbh I don't know - is it even possible with the underlying API?
dave
11/21/2022, 7:26 PM
Which server are you using?
a
Andrew O'Hara
11/21/2022, 7:31 PM
I'm currently using Netty. I know the RFC allows for redirects, and I'm sure Netty could be configured to do it via the channel handler. I was just wondering if http4k had any support for it; I don't think I want to go into the Netty internals.
d
dave
11/21/2022, 7:32 PM
Yeah - there isn't a way of doing it from the current API. Looking at jetty, it's not even in their API...
a
Andrew O'Hara
11/21/2022, 7:38 PM
I'll find a workaround. I need to do a crude form of WS load balancing in a situation where the amount of load would make an AWS Network LB cost prohibitive.
I figured if I could get a load-balanced WS server to redirect to the final host, I'd be good to go. I may instead require the clients to ask an HTTP API for the final WS URI. I don't think DNS load balancing would be a great fit. But this is all out of scope for http4k of course.