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

support for unix domain sockets? #101

Closed
glelk opened this issue Sep 26, 2018 · 2 comments
Closed

support for unix domain sockets? #101

glelk opened this issue Sep 26, 2018 · 2 comments

Comments

@glelk
Copy link

glelk commented Sep 26, 2018

I'd like to use unix domain socket as a server connection, but Server accepts only SocketAddr. I am aware of tokio-uds (which is btw archived) but could not find out how to use it in warp Server. There is also hyperlocal, but it provides its own server.

In general, wouldtn't the whole rust-net/web framework be more composable if servers (and clients) used a trait for connection instead of a concrete type? E.g. like Conn interface in go?

@seanmonstar
Copy link
Owner

In general, wouldtn't the whole rust-net/web framework be more composable if servers (and clients) used a trait for connection instead of a concrete type?

Yep! It's supported via hyper's Server::builder(incoming) API (and client) by being generic over T: AsyncRead + AsyncWrite.

In warp, it purposefully hasn't been exposed yet, as I had questions around exposing this generic interface. It's also somewhat related TLS (#83).

@stephanbuys stephanbuys mentioned this issue Sep 28, 2018
Closed
seanmonstar added a commit that referenced this issue Sep 28, 2018
- Adds `Server::run_incoming` to start running the runtime immediately.
- Adds `Server::serve_incoming` to return an `impl Future` that can be
  spawned in a runtime.

ref #83
ref #101
seanmonstar added a commit that referenced this issue Sep 28, 2018
- Adds `Server::run_incoming` to start running the runtime immediately.
- Adds `Server::serve_incoming` to return an `impl Future` that can be
  spawned in a runtime.

ref #83
ref #101
seanmonstar added a commit that referenced this issue Sep 28, 2018
- Adds `Server::run_incoming` to start running the runtime immediately.
- Adds `Server::serve_incoming` to return an `impl Future` that can be
  spawned in a runtime.

ref #83
ref #101
@glelk
Copy link
Author

glelk commented Sep 30, 2018

It works without a glitch, thank you!

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