Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

REQUEST: Specify unexpected status code #55

Closed
thijsvandien opened this issue Sep 23, 2019 · 5 comments
Closed

REQUEST: Specify unexpected status code #55

thijsvandien opened this issue Sep 23, 2019 · 5 comments

Comments

@thijsvandien
Copy link

When the server gives an error, the program indicates:

websocat: WebSocketError: Received unexpected status code

It would be nice if it would specify what the status code actually was, e.g.:

websocat: WebSocketError: Received unexpected status code (404)

@vi
Copy link
Owner

vi commented Sep 23, 2019

Indeed, the code is not visible even in verbose mode.

Probably should be in Websocat 2.0

@janpieper
Copy link

Any status on this issue? I had the same issue today and it took me some time to find out what's wrong.

@vi
Copy link
Owner

vi commented Jul 1, 2020

The status is like "waiting for inspiration to resume work on Websocat in general".

It may happen if/when I need to advance Websocat for myself for some need.


It would be reasonable to rewrite Websocat for a better architecture and newer dependencies, but the lack of real tests makes it tricky to do such rewrite without breakages. And just writing tests is typically boring and I instead switch to other project when I think about it too much...

(Also I'm not sure if Websockets in general would have a bright future in future HTTP/3 / QUIC world - one of reasons I have recently added crude SSE support to Websocat).


Maybe I can just merge & publish this particular change ahead of big changes, as it looks like there is some popular support for this change.

@vi
Copy link
Owner

vi commented Jul 6, 2020

Published websocket v0.26.1 with pull request above merged.

Next step is to build and upload websocat (probably 1.6.0, the 2.0 idea may be worth abandoning).

vi added a commit that referenced this issue Jul 8, 2020
@vi
Copy link
Owner

vi commented Jul 8, 2020

Published a release "v1.6.0" (including pre-built artifacts) with this issue resolved.

$ websocat ws://127.0.0.1:1234/
websocat: WebSocketError: Received unexpected status code (333 <unknown status code>)
websocat: error running
$ nc -lp 1234
GET / HTTP/1.1
Host: 127.0.0.1:1234
Connection: Upgrade
Upgrade: websocket
Sec-WebSocket-Version: 13
Sec-WebSocket-Key: 5+hWvcjTmn5dQGch4F0doA==

HTTP/1.1 333 QQQ^M
^M

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants