Lazarus

Programming => Networking and Web Programming => Topic started by: yahoo000 on October 29, 2020, 07:38:07 pm

Title: backconnect sock proxy ? how to ?
Post by: yahoo000 on October 29, 2020, 07:38:07 pm
Can someone give me idea, some examples or maybe some sources and help how to code backconnect sock proxy in lazarus? basically it is proxy sock server that works behind NAT with the help of my VPS server with public IP, client connect back to server, and then I can connect and send request to client using my server.

Title: Re: backconnect sock proxy ? how to ?
Post by: Thaddy on January 26, 2022, 06:34:13 pm
I would recommend reading up on Hole Punching and use the UDP version, not the TCP version.
This can be done in pure pascal, since e.g. the original Skype used it in Delphi code and Telegram uses it.
The most important bits are to send keepalive messages and to allow redirects. Note that it does NOT work on some corporate networks: symmetric traffic may not always be allowed.
https://en.wikipedia.org/wiki/UDP_hole_punching
The technique is rather intricate and apart from commercial implementations* I have not seen proper open source Object Pascal code for it.

* We implemented and used it at my employer Alex, later BinckBank, later Saxbank but by then I had already left, code is closed source. Sorry.( But we just used a version of synapse for it, maybe even just UDPSocket, nothing more). I gave enough pointers on how to do it. It is not for beginners, not even intermediates. You have to have a thorough understanding about network protocols and sockets.
Title: Re: backconnect sock proxy ? how to ?
Post by: Thaddy on May 25, 2022, 11:01:17 am
Dude, the reverse proxy identifies itself in services using its certificate.
A - reverse - proxy does not need a certificate. That is completely unrelated how it is implemented in cloud solutions.
Proper cloud solutions always use a certificate based solution, that part is true, but that is for other reasons unrelated to proxying.
TinyPortal © 2005-2018