snapview / tungstenite-rs

Lightweight stream-based WebSocket implementation for Rust.
Apache License 2.0
1.79k stars 208 forks source link

Connecting to a unix socket #415

Closed mdevils closed 3 months ago

mdevils commented 3 months ago

Could you please advice me, how do I connect to a unix socket by file path using tungstenite library?

agalakhov commented 3 months ago

Just connect to the socket first using the standard library. Then pass already connected socket to tungstenite. That's how it works.

daniel-abramov commented 3 months ago

Just a short elaboration: once you connect to the UNIX socket through regular means, you can pass the resulted stream to client() or other similar functions.

mdevils commented 3 months ago

@agalakhov, @daniel-abramov, thank you for your help guys, I've solved it using socket2 crate.