https://github.com/degitx/stun
RFC5389 / tiny STUN protocol client implementation on C / Get my ip
https://github.com/degitx/stun
cpp rfc5389 stun
Last synced: 7 months ago
JSON representation
RFC5389 / tiny STUN protocol client implementation on C / Get my ip
- Host: GitHub
- URL: https://github.com/degitx/stun
- Owner: DEgITx
- License: mit
- Created: 2021-09-21T22:43:17.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2021-10-04T23:23:03.000Z (about 4 years ago)
- Last Synced: 2025-02-02T10:32:45.403Z (8 months ago)
- Topics: cpp, rfc5389, stun
- Language: C
- Homepage:
- Size: 2.93 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Linux:
```bash
gcc stun.c stun_get_addr.c
```Windows (mingw):
```bash
gcc stun.c stun_get_addr.c -l ws2_32
```then
```
./a 173.194.222.127 19302 4233
```implementation (include stun_get_addr.c in your project):
```c
int stun_get_addr(char *stun_server_ip, short stun_server_port, short local_port, char *return_ip, short *return_port);
```example:
```c
char return_ip[50];
short return_port;
if (stun_get_addr("173.194.222.127", 19302, 4233, return_ip, &return_port) == 0) {
printf("%s\n", return_ip);
} else {
printf("some error\n");
}
```