954,518 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

How can my LAN-Chat work over INTERNET?

I develop a chat (server and client) using Sockets. It's working on LAN but when I try to connect the client to the server using my public IP address it says it cannot connect to that address. My address is public - a friend pinged my address successfully. You find everywhere examples and code for chat applications - but only over local network.
What's the problem? How can my chat work over the Internet? (I can post code if necesarry).
Please help me. I need this so much!

Clawsy
Posting Whiz in Training
225 posts since Feb 2008
Reputation Points: 11
Solved Threads: 7
 

i need help with this too...

stevanity
Posting Whiz in Training
293 posts since Oct 2010
Reputation Points: 43
Solved Threads: 28
 

First: picking up an almost 2 year old thread :sigh:
Second: look up RMI (Remote Method Invocation) http://download.oracle.com/javase/tutorial/rmi/index.html

Aviras
Junior Poster in Training
82 posts since Jul 2008
Reputation Points: 24
Solved Threads: 8
 

Question asked 2 years ago....

However , if your chat application(using sockets) works over intranet(LAN) successfully then it WILL and should work over internet also..
Check the source code whether the server and client IP's and port numbers are correct..

harinath_2007
Posting Whiz
355 posts since Aug 2010
Reputation Points: 78
Solved Threads: 36
 

That is not an issue, at least if you entered the real IP, not your intranet IP, e.g. starting with 192.168. If you entered the correct info your firewall might be troubling you, which is why i suggested using RMI, since it has built in http tunneling.

Aviras
Junior Poster in Training
82 posts since Jul 2008
Reputation Points: 24
Solved Threads: 8
 

Ok. Thanks for that. Ill use RMI for my program! Thanks. Yeah my router does not have proper portforwarding facilities. I configured NAT to forward all ports. Then the ports were open for an hour or so and suddenly everything went dark....

But the app works well with local loop. Thanks for the help!!!!

stevanity
Posting Whiz in Training
293 posts since Oct 2010
Reputation Points: 43
Solved Threads: 28
 

You can forward your Port used in Chat Softwar from your router... then you will be able to use that software over the internet :)

Vaspar
Light Poster
28 posts since Feb 2011
Reputation Points: 19
Solved Threads: 1
 

It will only work using your local machine.
RMI is a lot more 'waterproof' and user-friendly, since the client won't have to do anything.

Aviras
Junior Poster in Training
82 posts since Jul 2008
Reputation Points: 24
Solved Threads: 8
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: