Does the websocket API actually work? #2283
Replies: 2 comments 3 replies
-
Yes it does. Otherwise we would have caught it in the two+ years axum has been out 😅 As for your issue, I’m not sure. Currently traveling so can’t test your code. I recommend asking in the tokio discord which has axum channel. |
Beta Was this translation helpful? Give feedback.
-
@spencerkohan Did you manage to solve this? A colleague has been struggling with this for a few days and I've just started digging into it to try and figure out what's wrong. As an aside this is definitely an area where the axum trace logging could be improved. As a warp user I can see a breakdown of the routing decisions made and that has made debugging issues like this far simpler though for axum I can't tell what route is chosen or why the routes are rejected. |
Beta Was this translation helpful? Give feedback.
-
Bug Report
Version
axum = { version = "0.6.20", features = ["ws", "headers"] }
Platform
Darwin SK-Air-M2.fritz.box 22.2.0 Darwin Kernel Version 22.2.0: Fri Nov 11 02:06:26 PST 2022; root:xnu-8792.61.2~4/RELEASE_ARM64_T8112 arm64
Description
I am trying to implement a websocket server based on the example in the 0.6.x branch.
I am using this code:
I try to connect using:
wscat -c ws://localhost:8080/ws
Expected behavior:
eprintln!("user_agent at {addr} connecting: {:#?}", addr);
should print something when the socket connection is attemptedActual behavior:
error: Unexpected server response: 500
Is this API actually supposed to be working, and is there anything I can do to debug the issue?
Beta Was this translation helpful? Give feedback.
All reactions