Skip to main content
0 votes
0 answers
31 views

Return an HTTP error response in rust tokio tungstenite

I'm trying to build a websocket server using rust tokio tungstenite. When the user connects, I want them to specify a roomID as a request query parameter. If this roomID parameter does not exist, I ...
Ethan Crabb's user avatar
0 votes
1 answer
72 views

Is is possible to share a tungstenite WebSocket connection across threads?

I would like to build a server that spawns a separate thread each for reading from and writing to a tungstenite-rs WebSocket connection, but the WebSocket object does not seem to implement clone() or ...
Markus A.'s user avatar
  • 12.7k
2 votes
1 answer
105 views

Trait bound not satisfied for MaybeTlsStream<TcpStream> in tokio-tungstenite

I'm trying to build a struct that handles async websocket communication. I'm working on getting the connection set up and, as part of that, I'm using tokio_tungstenite::connect::connect_async(). I ...
Jacob Moreno's user avatar
1 vote
1 answer
381 views

How to do a blocking read with timeout with tokio-tungstenite?

Is there a straightforward API to block with timeout on reading the next websocket message in tokio-tungstenite? Right now, I have: read.next().await where read is a SplitStream<WebSocketStream<...
mentics's user avatar
  • 6,989
1 vote
1 answer
48 views

Blocking websocket interrupted by resizing the terminal (os error 4)

Some friends and I are currently working on an online Pong game on website. The game works great but I wanted to make a Rust CLI application allowing the user to play versus online player on the ...
Groux's user avatar
  • 61
0 votes
0 answers
56 views

GraphQL Subscriptions Using Tungstenite

I'm trying to use tokio-tungstenite to subscribe to a graphql endpoint. I've been able to establish a handshake with the server (ping and pongs get logged) but I can't figure out how to pass my ...
C-RAD's user avatar
  • 1,031
0 votes
0 answers
145 views

Is it possible to accept a WebSocket request by using only the request and not the stream?

I am trying to make an HTTP and WebSocket server in Rust using hyper and tungstenite. I need to accept WebSocket upgrades in a function where I handle HTTP requests. This function only has the request ...
CodingMaster239's user avatar
1 vote
2 answers
102 views

Detect the incoming protocol for TcpStream

My service collects and displays some statistics using socket communication. Some clients connect to it through web browsers using WebSocket protocol, while others use Windows services that use ...
Raeisi's user avatar
  • 2,146