We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I would like to spawn a ws server easily with wss support without generate myself the certificate. does it possible?
ws
wss
My code:
use futures::StreamExt; use futures::FutureExt; use warp::Filter; #[tokio::main] async fn main() { let echo = warp::path("echo") .and(warp::ws()) .map(|ws: warp::ws::Ws| { ws.on_upgrade(|websocket| { let (tx, rx) = websocket.split(); rx.forward(tx).map(|result| { if let Err(e) = result { eprintln!("websocket error: {:?}", e); } }) }) }); let current_dir = std::env::current_dir().expect("failed to read current directory"); let routes = warp::get().and(echo.or(warp::fs::dir(current_dir))); warp::serve(routes) .tls() // .cert_path("cert.pem") // <--- I want to avoide this line // .key_path("key.rsa") // <--- I want to avoide this line .run(([0, 0, 0, 0], 9231)).await; }
The text was updated successfully, but these errors were encountered:
warp does not have support built-in. You might be able to find something prebuilt. I wouldn't want to add it to warp.
Sorry, something went wrong.
No branches or pull requests
I would like to spawn a
ws
server easily withwss
support without generate myself the certificate.does it possible?
My code:
The text was updated successfully, but these errors were encountered: