snapview / tokio-tungstenite

Future-based Tungstenite for Tokio. Lightweight stream-based WebSocket implementation
MIT License
1.88k stars 236 forks source link

Is it possible to bind client to specific interface? #320

Closed 677-dadi closed 9 months ago

677-dadi commented 9 months ago

Hi all,

We've been using tokio-tungstenite on the client side in production for a couple of years now, so thanks for a great crate 🙏

I now have the need to bind the websocket (client side) to a specific network interface, but not finding that exposed in tungstenite.rs or tokio-tungstenite. Am I missing something? Anybody have a suggestion on how to accomplish that?

Regards, dadi

daniel-abramov commented 9 months ago

Hey. It's possible, but the binding part is outside of the scope of this crate. I.e. you need to bind the interface by other means and then you can pass the resulted stream to tokio-tungstenite so that we run the websocket protocol on top of your AsyncRead + AsyncWrite stream.