https://github.com/oneclickvirt/gostun
本机NAT类型检测工具(Local NAT type detection tool)(NatTypeTester)
https://github.com/oneclickvirt/gostun
detector freebsd goecs linux nat nattype nattypetester openbsd rfc3489 rfc4787 rfc5780 stun tcp tls udp
Last synced: 3 months ago
JSON representation
本机NAT类型检测工具(Local NAT type detection tool)(NatTypeTester)
- Host: GitHub
- URL: https://github.com/oneclickvirt/gostun
- Owner: oneclickvirt
- License: apache-2.0
- Created: 2024-05-05T07:00:08.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2024-07-02T05:49:36.000Z (10 months ago)
- Last Synced: 2024-10-29T22:36:41.464Z (6 months ago)
- Topics: detector, freebsd, goecs, linux, nat, nattype, nattypetester, openbsd, rfc3489, rfc4787, rfc5780, stun, tcp, tls, udp
- Language: Go
- Homepage: https://github.com/oneclickvirt/ecs
- Size: 72.3 KB
- Stars: 25
- Watchers: 0
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# gostun
[](https://hits.seeyoufarm.com) [](https://github.com/oneclickvirt/gostun/actions/workflows/main.yaml)
本机NAT类型检测工具
Local NAT type detection tool (NatTypeTester)
## 类型说明[Information]
```
NatMappingBehavior:
inconclusive
endpoint independent (no NAT)
endpoint independent
address dependent
address and port dependent
``````
NatFilteringBehavior:
inconclusive
endpoint independent
address dependent
address and port dependent
```| NAT Type | Nat Mapping Behavior | Nat Filtering Behavior |
|----------------------|------------------------|----------------------|
| Full Cone | ```endpoint independent``` | ```endpoint independent``` |
| Restricted Cone | ```endpoint independent``` | ```address dependent``` |
| Port Restricted Cone | ```endpoint independent``` | ```address and port dependent``` |
| Symmetric | ```address and port dependent``` | ```address and port dependent``` |
| Inconclusive | ```inconclusive``` | ```inconclusive``` |## TODO
- [ ] 加入UDP检测
## 使用说明[Usage]
下载、安装、更新
```
curl https://raw.githubusercontent.com/oneclickvirt/gostun/main/gostun_install.sh -sSf | sh
```使用
```
gostun
```或
```
./gostun
```进行测试
无环境依赖,理论上适配所有系统和主流架构,更多架构请查看 https://github.com/oneclickvirt/gostun/releases/tag/output
```
Usage: gostun [options]
-e Enable logging functionality (default true)
-h Display help information
-server string
Specify STUN server address (default "stun.voipgate.com:3478")
-timeout int
Set timeout in seconds for STUN server response (default 3)
-v Display version information
-verbose int
Set verbosity level
```
## 卸载
```
rm -rf /root/gostun
rm -rf /usr/bin/gostun
```## 在Golang中使用
```
go get github.com/oneclickvirt/gostun@latest
```## 感谢[Thanks]
https://datatracker.ietf.org/doc/html/rfc3489#section-5
https://datatracker.ietf.org/doc/html/rfc4787#section-5
https://github.com/pion/stun/tree/master/cmd/stun-nat-behaviour