Lnet simple online lazarus / 38-Networking and Web Programming ---------------------------------------------------------------------- Jake012345 · 2020-05-03 12:39 Hello! I wrote a simple Lnet TCP/IP chat program. It works fine. On LAN. BUT I want to use it online, and I wrote it, because I thought, it will works on Internet and I now sad. I attached it to post. I tried it out with port forwarding and it works online with it but that's not enough. I don't want to use port forwarding to my online programs. Maybe the TCP/IP don't work without it? Is there any connection type what can work without forwarding? And... I need very simple mode of connection. I'm not a master of programming. Especially of web programming. ---------------------------------------------------------------------- balazsszekely · 2020-05-03 13:31 Hi Jake, You have two solutions: 1. For outgoing connection you don't need port forwarding. The clients can easily connect to an outside server, assuming that are not filtered by a firewall or AV program,  browsers connects in a similar fashion. All you have to do is to make sure, that your server is "visible" for the clients. If the server is behind a router, you do need port forwarding, but only for the server. More over, the client application needs to know the ip address of the server, this can be somewhat problematic if you have a dynamic IP. To resolve this issue, use a service like no-ip(https://www.noip.com/). Basically it works like this:    a. When the computer behind the router(on which the server resides) starts, a small application provided by noip, connects to www.noip.com and the dynamic ip si resolved to a predefined host like "JakesHomeServer".    b. The client application will always connect to "JakesHomeServer" As a conclusion you do need one port forward, but only for the server. For dynamic ip, use external help like noip, which has a limited free version. If the server is located behind a router you don't have access to(your work place for example), you can bring in the heavy artillery like a ssh server combined with putty, but this is another story. 2. TCP hole punching. This is how chat programs communicate even though they are behind a router. In order for this to work you still need an external server for the initial connection. TCP hole punching is not trivial to implement, more over sometimes will not work, depending on the NAT traversal. ---------------------------------------------------------------------- Jake012345 · 2020-05-04 07:10 Hi! Is there any way to do it with add-ons? Exist any mode? In my program, the server is also a client, just run the server program. Or exist any VPN program what have API-s or similar things what I can use for my program? I'm very happy, because I found out, my program is working over internet so it can be a global server, but first I want to write VPN platformed programs. Without too many works for users. ---------------------------------------------------------------------- Ericktux · 2020-08-29 02:06 hello friend Jake012345 If it's not too much trouble you can share your chat code please. I would also like to create a chat program. ---------------------------------------------------------------------- Jake012345 · 2020-09-02 10:20 Uhh.... Sure. But..I wrote these a few months ago. So I'll search in my projects. Or may create a new one. Sure IF you already need it. ---------------------------------------------------------------------- Jake012345 · 2020-09-02 10:25 I used Synapse for networking. I can made some with LNet If you want. ---------------------------------------------------------------------- Jake012345 · 2020-09-02 10:27 And write me e-mail if you want. I have Hangouts too for chat. ---------------------------------------------------------------------- Jake012345 · 2020-09-02 20:58 In theory That's it: https://titantitan028.wixsite.com/fpcshare/forum/projects-to- share/freepascal-synapse40-blocksocket (or attachment)