mirror of https://github.com/dswd/vpncloud.git
Fix #350
This commit is contained in:
parent
28b1c76d70
commit
358183ef12
|
@ -6,6 +6,7 @@ This project follows [semantic versioning](http://semver.org).
|
||||||
|
|
||||||
- [changed] Changed Rust version to 1.73.0
|
- [changed] Changed Rust version to 1.73.0
|
||||||
- [changed] Updated dependencies
|
- [changed] Updated dependencies
|
||||||
|
- [fixed] Fix error when IPv6 is not available
|
||||||
|
|
||||||
### v2.3.0 (2021-12-23)
|
### v2.3.0 (2021-12-23)
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,7 @@ pub fn mapped_addr(addr: SocketAddr) -> SocketAddr {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn get_ip() -> IpAddr {
|
pub fn get_ip() -> IpAddr {
|
||||||
let s = UdpSocket::bind("[::]:0").unwrap();
|
let s = UdpSocket::bind("0.0.0.0:0").unwrap();
|
||||||
s.connect("8.8.8.8:0").unwrap();
|
s.connect("8.8.8.8:0").unwrap();
|
||||||
s.local_addr().unwrap().ip()
|
s.local_addr().unwrap().ip()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue