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

Connect to ws+unix:///tmp/some.sock #14

Open
fgadaleta opened this issue Jun 29, 2022 · 4 comments
Open

Connect to ws+unix:///tmp/some.sock #14

fgadaleta opened this issue Jun 29, 2022 · 4 comments

Comments

@fgadaleta
Copy link

Is it possible to connect to a UDS based websocket (spawned by e.g. hyperlocal)?

@de-vri-es
Copy link
Owner

This crate is for accepting websocket connections in a hyper based server. It is not for connecting to servers.

But that said, if hyper supports Unix sockets, then I think it should work here too.

@fgadaleta
Copy link
Author

hyperlocal supports UDS and binds to a UDS indeed.
So i guess I need a way to bridge hyperlocal <> tokio-tungstenite to get a websocket over a UDS-based socket...

@de-vri-es
Copy link
Owner

It should be possible, the only thing tokio-tungstenite wants is for the underlying socket to be AsyncRead + AsyncWrite + Unpin: https://docs.rs/tokio-tungstenite/latest/tokio_tungstenite/struct.WebSocketStream.html#method.from_raw_socket

@de-vri-es
Copy link
Owner

de-vri-es commented Jun 30, 2022

Btw, I would be open to adding support for hyperlocal with a feature flag if needed. Does hyperlocal reuse the existing hyper::Request type or does it have it's own?

/edit: But judging from the example, everything should just work out of the box: https://docs.rs/hyperlocal/latest/hyperlocal/trait.UnixServerExt.html

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

2 participants