Meaningless Drivel is fun!
The moose likes Distributed Java and the fly likes Localhost Vs IP Address Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Distributed Java
Bookmark "Localhost Vs IP Address" Watch "Localhost Vs IP Address" New topic

Localhost Vs IP Address

Prateek Sharma

Joined: Jul 20, 2008
Posts: 23
I have an application. which takes the snap (using web camera) on the any network machine when i provide the ip address/username/password of that machine.(It uses JMF)

To access this application I provide http://ipaddress_of_server/ in my browser, In that case it works fine.

But when I work on the server and provide 'localhost' at the place of IP like http://localhost/ in my browser, The JMF (java media framework) part of that application doesnt work.

In short JMF part of the application only works when I provide the ip of the server in browser. If I use 'localhost' it doesn't work.

I'm not sure but I think some how this problem is because of RMI.

Can anybody tell me what may be the reason....

Thanks in Advance

Prateek Sharma
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42965
I think some how this problem is because of RMI.

Why do you think that? You mention a browser and JMF - where does RMI fit in?
Amit Ghorpade

Joined: Jun 06, 2007
Posts: 2851

Did you try in place of localhost and domain-name of the machine in place of ip address of the server?

|Asking Good Questions|
David Westbrook

Joined: Dec 18, 2008
Posts: 16
i just learned about this stuff a couple days ago, so don't take what i'm saying as golden, but it might be something you haven't thought of.

do you remember setting any port numbers when installing your webserver? did you just install w/defaults?

try http://localhost:8080/

i know when i installed apache, it sets up port 8080 to take stuff in.

explanation (again, keep in mind i just learned this stuff so it might not be completely accurate):

whenever you see http://something you are automatically going to port 80 of that machine. so if you go http://yourServerIP/ it will boomerang a message out, which will come back into your port 80. If your ip is hosting server, then it takes incoming port 80 and sends it to whatever port you specified when installing your webserver. I hope that helps at least to point you in right direction.
I agree. Here's the link:
subject: Localhost Vs IP Address
It's not a secret anymore!