An open API service indexing awesome lists of open source software.

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

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");
}
```