-
-
Notifications
You must be signed in to change notification settings - Fork 708
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
Review: how to listen on both ipv4 and ipv6? #628
Comments
you can also bind to both Ipv6 and Ipv4: let addr = IpAddr::from_str("::0").unwrap();
warp::serve(endpoints).run((addr, 3030)).await; |
hi @jxs using
|
you need to import it: use std::net::IpAddr;
use std::str::FromStr; |
@jxs wrote:
This depends on whether the OS you're running on has the I'm doing the above, running on a Linux system that is configured for But I have colleagues testing a Windows build, and are reporting that they can't connect to eg So I'm trying to work out the most reliable solution that works for both Linux, regardless of It is possible to use the |
This has been asked on StackOverflow: How to listen on multiple ports with warp? |
In #456, @nbari asked how it is possible to listen on both ipv4 and ipv6 at the same time, and the issue stalled.
I have a
main.rs
file that is something like this:This seems to be working, but I'm not sure if this is a good way to do what was desired and would like some feedback on how it could be done.
Originally posted by @nbari in #456 (comment)
Thanks!
EDIT: I forgot to mention, I'm doing this in stable rather than nightly.
The text was updated successfully, but these errors were encountered: