In general, I am writing a C program for NAT traversal (using VPS, it will work as a reverse proxy, but the connection will be made by the computer), I make the client under Windows, and I have a problem when the VPS receives a message that it has a request , I need to artificially “start up” a TCP packet in my computer, in which I will point out the destination IP and the sender’s IP in my hands.

I would like to do this without resorting to NDIS.

I hope clearly explained my problem.

  • If the client is behind NAT, then it can only receive a response within its TCP session, i.e. strictly from the same ip and port on which he addressed. Packet with other parameters is useless to send, NAT will not miss - Mike
  • What I am talking about here is a joke as a VPN, a packet is encapsulated in a TCP packet, in which the necessary data is indicated in the data, such as IP, etc., this TCP packet will come to my computer, and there I will have to create an artificial packet , so for the computer everything seemed like NAT'a and no - FunMelon 5:26 pm
  • one
    but your server can open any connection only from its ip. so transfer from the client ip and the port of the sender of the packet is useless. He only has to communicate with whom to connect. after that, the server opens the necessary connection with completely standard means from its ip and sends traffic going within the session to the client. Or, if you need incoming connections, again, it opens a dynamic port on its ip and informs its client that it can inform someone of it. in fact, all this provides the protocol Socks - Mike

0