websocat
websocat copied to clipboard
Support HTTP Redirection at Handshake
Hi!
I like to request that the server can send a http redirect (3xx) and websocat allows to handle this.
It seems WebSocket allows this: https://www.rfc-editor.org/rfc/rfc6455
1. If the status code received from the server is not 101, the
client handles the response per HTTP [[RFC2616](https://www.rfc-editor.org/rfc/rfc2616)] procedures. In
particular, the client might perform authentication if it
receives a 401 status code; the server might redirect the client
using a 3xx status code (but clients are not required to follow
them), etc. Otherwise, proceed as follows.
At least printing of Location: in a more user-friendly way can be an option for quick implementation.
Proper redirects may be more of Websocat3 material.
In Websocat 1.12:
$ websocat ws://127.0.0.1:7780/
websocat: WebSocketError: WebSocketError: Redirected (302 Found) to http://example.com/
websocat: error running