How to get ip in Rust?

Best way to get your own IPs

Any progress for this issue? It was closed. But I am facing the same issue.

Back in the other thread the gpl was a stated issue. The get_if_addrs crate is now bsd and mit.

emmm, It had been archived for three years.

That shouldn't automatically disqualify it. Have you tested it? Does it produce warnings or errors with recent compilers? If the library is limited in scope, it can be perfectly usable despite the lack of updates. I don't see any glaring omissions for this one on first glance. (Don't trust me, of course, do your own tests.)

This is the crate used in Deno.

1 Like

Thanks, I will try it later.

For a Rust fresher, I believe an option for a mature project. I will try netif :slight_smile:

Its sample doesn't work.

Works fine. Just some packages will be rejected by a future version of Rust.
Finally, I use this package local-ip-address

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.