Open
Description
fasthttp/websocket module returns "websocket: bad handshake" error when HTTP response code is different than 101 or header values are incorrect. This hides any other non-websocket HTTP errors like 401 Unauthorized, 404 Not Found, 500 Internal Server Error, etc. Recently I was debugging one such issue and had to modify fasthttp/websocket to see what was wrong. Please add new error to report non-101 response from server. Make sure to allow getting HTTP status code from error - some errors may need special handling beside logging, e.g. prompt user for credentials when server returns 401 Unauthorized.
https://github.com/fasthttp/websocket/blob/master/client.go#L393-L396