Is there any way to send a redirect in response to...
# http4k
a
Is there any way to send a redirect in response to a websocket request?
d
Tbh I don't know - is it even possible with the underlying API?
Which server are you using?
a
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
Yeah - there isn't a way of doing it from the current API. Looking at jetty, it's not even in their API...
a
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.
109 Views