1 unstable release
0.1.7 | Feb 19, 2022 |
---|---|
0.1.6 |
|
#26 in #stun
139 downloads per month
26KB
290 lines
nat-detect
a simple nat detect implementation for rust
+--------+
| Test |
| I |
+--------+
|
|
V
/\ /\
N / \ Y / \ Y +--------+
UDP <-------/Resp\--------->/ IP \------------->| Test |
Blocked \ ? / \Same/ | II |
\ / \? / +--------+
\/ \/ |
| N |
| V
V /\
+--------+ Sym. N / \
| Test | UDP <---/Resp\
| II | Firewall \ ? /
+--------+ \ /
| \/
V |Y
/\ /\ |
Symmetric N / \ +--------+ N / \ V
NAT <--- / IP \<-----| Test |<--- /Resp\ Open
\Same/ | I | \ ? / Internet
\? / +--------+ \ /
\/ \/
| |Y
| |
| V
| Full
| Cone
V /\
+--------+ / \ Y
| Test |------>/Resp\---->Restricted
| III | \ ? /
+--------+ \ /
\/
|N
| Port
+------>Restricted
Install
cargo install nat-detect
Usage
# use default stun server list
# may be, these default servers will not good work in your net!
nat-detect
# use stun server 193.43.148.37:3478
nat-detect -s 193.43.148.37:3478
default stun server list use always-online-stun
Dependencies
~6–13MB
~138K SLoC