When the Dial() fails, my suggestion is to write 503 Service Unavailable to the ResponseWriter.
The typical use case would be when writing middleware, wrapping the ResponseWriter and acting on possible failures in upgrade or dial. With this addition that would be possible. If there are better ways to solve the error mode, I'd appreciate comments on the better way to handle it.
If the change would be accepted, I could do the PR, if added to contributors.
https://github.com/koding/websocketproxy/blob/944ae4ae170f3afa1e0683bcc3230d34c21e70eb/websocketproxy.go#L134
When the
Dial()
fails, my suggestion is to write 503Service Unavailable
to theResponseWriter
.The typical use case would be when writing middleware, wrapping the
ResponseWriter
and acting on possible failures in upgrade or dial. With this addition that would be possible. If there are better ways to solve the error mode, I'd appreciate comments on the better way to handle it.If the change would be accepted, I could do the PR, if added to contributors.