IRC / p2p with lazarus lazarus / 38-Networking and Web Programming ---------------------------------------------------------------------- seany · 2015-04-03 02:45 I want to communicate between a group of personal computers. Each computer is behind a router, which can not be accessed by the user to set up port forwarding. Computers use Linux as well as M$ Windows, so I want to use Lazarus / Freepascal, to write identical softwares, that can be compiled in either machine. Assuming I have an appropriate network that all computers located in different places of the world can acces, what I plan to do is this : I want to spread messages over the network, the messages are formatted . Anyone can provide answers to the request messages (since this is a proof of concept, I am less worried about security implications, I am more interested in flexibility - this is why freenet is less than optimal, because it is focused on security.) using any software they want, they can also receive the messages using any software they want. Therefore, to formulate it differently, I need:     Set up a decentralized network, regardless of the router configurations. This should work on M$ as well as Linux. Teamviewer comes to mind, but the message protocols are propreitary On top of this network, softwares should process the messages. They should be able to receive messages, as well as send answers to requests, as well as new messages.   The network that carries the messages should be able to forward the messages to particular targets, e.g. localhost. That is, if someone wants to setup an apache, and listen to requestes to localhost that should not be a problem. That is not a problem anyway, because any software listening to the message can "forward" the message to localhost on a local machine.Thus, using simple graphics : Network that carries messages should work like : Computer A <----> Unknown Router configuration <----> internet <----> Unknown router again <------> Volunteer Computer B Once the message is landed in a particular computer : Unknown router <-----> Computer <-----> Software listening to messaging network <-----> forwards the requests to localhost <-----> Apache / Nginx / ... other appropriate software. I thought about a P2P based solution, someone in the netwrok sends a request in the network, and if someone can answer this, they answer. I will need a solution that is router independant. The other way would be to use an IRC network, each software, when needed, programatically contacts a IRC channel, to transfer messages. The yet other way would be to use a nat-to-nat communication. RUDP comes to mind, but I notice the difficulty in implementation. What are my options to implement platform independent P2P / Nat-to-Nat or IRC in Lazarus? Note: The latest version of lnet does not come with lIRCbot any more. I am told that I can use Synapse. Are there OOP components (in .lpk format) for Lazarus that encapsulates P2P or IRC (IRC bot) functionalities? If so what are they? Thank you ---------------------------------------------------------------------- avra · 2015-04-06 07:14 Quote from: seany on April 03, 2015, 04:45:05 amI will need a solution that is router independant.Couldn't you simply use some VPN (like OpenVPN) to create private network for all your computers, and then simply exchange messages between them like they are all on a local network? That would probably give you the greatest flexibility in choosing a method to exchange messages, and security and router pass through would be simplified and given to external proven concept. ---------------------------------------------------------------------- seany · 2015-04-06 08:52 There are new computers joining the group and others going out - so instead of attaching them to VPN by hand, IRC would be simpler. I got Indy running. IRC connects. IdIRC1.connected is true. But asking to join a channel without a password (IdIRC1.join(str1, str2) is causing this error: Project has raised Exception class EIdConnClosedGracefully with the message : Connection Closed gracefully That is the approximate translation to English. str2 is set as '', empty string. This is the code I am using to join a channel :           IdIRC1.Join(Edit2.Text, Edit4.Text); log('channel joined with password', Memo1);  Edit2.Text is set to #Orcan, with the # symbol Edit4.Text is set to '' (Empty string) Please help ---------------------------------------------------------------------- taazz · 2015-04-06 15:37 http://www.indyproject.org/kb/whydoikeepgettingeidconnc.htm ---------------------------------------------------------------------- avra · 2015-04-07 10:44 Quote from: seany on April 06, 2015, 10:52:40 amThere are new computers joining the group and others going out - so instead of attaching them to VPN by hand, IRC would be simpler.If you need more power then IRC can provide take a look at Telegram: https://telegram.org ---------------------------------------------------------------------- seany · 2015-04-07 22:34 Could you help me finding OOP components for lazarus to implement this? ---------------------------------------------------------------------- rasberryrabbit · 2015-04-08 00:04 Maybe not source of concept exist. Other language example of "udp hole punching". https://gist.github.com/koenbollen/464613 http://stackoverflow.com/questions/12136031/udp-hole-punching-have- server-talk-to-client https://github.com/ckennelly/hole-punch