Forum > Networking and Web Programming

Client > Server > Client

(1/2) > >>

Jishaxe:
Hallo, fellow Lazarusers.
I wish to write a program for educational purposes. It's a 1 to 1 chatroom, and is designed to:

* Have a copy of the program on both computers that would like to communicate. (Mine and a friends)
* Be able to send simple text via the Internet and recieve it on the other computerThe problem is, the original design of the program was that the server program was on my computer, and a client on another. But I need to set up port forwarding on my router to have them connect, and I'd rather not do that.
I was wondering if there was a way I could

* The person operating the first client program would type in a string and hit 'send'.
* The client program sends the string to the server (Not hosted by me, maybe a website designed just for this?)
* The server then sends the same string to the other client, 'forwarding' it. The client recieves it and prints it out on the screen.I think this is how most chatting programs work, such as MSN messenger.
The question is, is there a free server out there that does what I request?
If so, please explain to me how to use it.
Thanks, Jishaxe.

Ocye:
IMHO there cannot be such a generic server. Your task can be done by "net send" on Windows and "smbclient" (or many other) on Linux. Each client runs its own service - and that's the way you could start to code. Run a server that listens at a specific port and handle messages, sent by a client to this port, like you want. BTW: be aware of open ports, firewalls, routers, virus scanner etc. A good starting point to network programming is Ararat's homepage (author of Synapse).

Jishaxe:
Thanks for answering.
The programming part of it I know, I've written a server/client program before and ran them both on localhost.
They worked.
My problem is I do not want to configure my router to forward data to my computer to make it a server, I was wondering if there was a way around it.
Thanks, Jishaxe.

Ocye:
You could use port 80 (http) or 21 (ftp). Or connect to any server that hosts a file or a database that is (ab)used for your chat messages. Sounds like a simple task in PHP  8)

Jishaxe:
So by using port 80 a client program can connect to the server program via the Internet?

Navigation

[0] Message Index

[#] Next page

Go to full version