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

Support for Websocket over Http/2 and axum 0.8 #95

Closed
radudiaconu0 opened this issue Dec 18, 2024 · 5 comments
Closed

Support for Websocket over Http/2 and axum 0.8 #95

radudiaconu0 opened this issue Dec 18, 2024 · 5 comments

Comments

@radudiaconu0
Copy link

I see that axum introduced here support fo websokcets over https/2. Can we have that too? And maybe support with axum too? Maybe an update to the future axum 0.8 will be good too

@szguoxz
Copy link

szguoxz commented Jan 4, 2025

This crate seems not maintained any more, this is ODD.
Maybe go back to tungstenite-rs?
I switched to here from tungstenite-rs because I heard it's fast, but it's frustrated to see there's no checkin in last 6 months. It can not compile with latest Axum anymore.
Now I understand why people say: Fast is not the only thing you need to pay attention to. :-)

@littledivy
Copy link
Member

You can do HTTP/2 WebSocket upgrade yourself and pass the upgraded stream to fastwebsockets.

Happy to accept PRs that makes HTTP/2 upgrades work with with_axum feature in this crate.

@radudiaconu0
Copy link
Author

Yeh it cannot compile with the lastest axum (0.8)

)
| --- ^^^^^^^^^^^^^^^^^ the traitHandler<_, _>is not implemented for fn itemfn(Path, Query, IncomingUpgrade, State<Arc<...>>) -> ... {handle_ws_upgrade}

    
    pub async fn handle_ws_upgrade(
    Path(app_key): Path<String>,
    Query(params): Query<ConnectionQuery>,
    ws: upgrade::IncomingUpgrade,
    State(handler): State<Arc<ConnectionHandler>>,
) -> impl IntoResponse {
    // let (response, fut) = ws.upgrade().unwrap();
    // tokio::task::spawn(async move {
    //     if let Err(e) = handler.handle_socket(fut, app_key).await {
    //         eprintln!("Error in websocket adapter: {}", e);
    //     }
    // });
    // response
    return "Hello";
}

@radudiaconu0
Copy link
Author

i hope somebody fixes it

@littledivy
Copy link
Member

Fixed in 9101613

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