Send a TCP/UDP request to STUN server using C language



In this post I will tell you how you can send a binding request to any available free STUN server using a C program


Step 1 - You will need a LINUX environment to run the code so you can either use a LINUX operating system or you can use WSL.


Step 2 - Now you need to run the C code given below, type "gcc stun.c" to run the code where stun.c is the file name, it will generate an executable file a.out


Below is the screenshot showing how to compile the code.



Step 4 - Now you need to run the executable file a.out

you need to type ./a.out <STUN server IP> <STUN server PORT> <local PORT> on your terminal

below is the screenshot for your refrence




As you can see in the above screenshot it is showing my public IP and PORT

Comments

Popular posts from this blog

Top 10 best pc games to try in 2023

How to enable developer option in xiaomi/poco/redmi phones

Remotely connect to your pc over internet