Crates.io | nat-detect |
lib.rs | nat-detect |
version | 0.1.7 |
source | src |
created_at | 2022-02-18 04:12:26.541282 |
updated_at | 2022-02-19 12:37:19.869906 |
description | a simple nat detect implementation for rust |
homepage | |
repository | https://github.com/blazood/nat-detect |
max_upload_size | |
id | 534527 |
size | 50,226 |
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