The Design of Software (CLOSED)

A public forum for discussing the design of software, from the user interface to the code architecture. Now closed.

The "Design of Software" discussion group has been merged with the main Joel on Software discussion group.

The archives will remain online indefinitely.

Using http://somname.com instead of http://localhost/

I have a Windows application with an embedded web server and would like to access this from other PC's on the LAN using a URL instead of an IP address or localhost on the same PC.

I understand I can edit the HOSTS file on each PC, but don't like this solution.

Is a simple embedded DNS Server the way to do this and if so can anyone recommend code for same, preferably C++.

Or maybe there is some other way.
Neville Franks Send private email
Saturday, October 25, 2008
 
 
Surely these are either domain or workgroup machines. In that case just use the machine name of the hosting machine:

http://IIS037/vdir/resource.zip
Codger
Saturday, October 25, 2008
 
 
Yeah, you can't really "embed" a DNS server into your app without hijacking DNS for the whole network. And I'm sure you are not prepared to do that. Just use the machine name of the machine in question.
uggh
Saturday, October 25, 2008
 
 
>Surely these are either domain or workgroup machines. In that case just use the machine name of the hosting machine:

>http://IIS037/vdir/resource.zip

I knew there was something obvious that I was missing. Thanks.
Neville Franks Send private email
Sunday, October 26, 2008
 
 
You are missing the obvious anwser. As well as using http://www.domain.com/ you can use http://IPaddress/

This means that http://localhost is the same as http://127.0.0.1

As each PC in your local network has its own unique IP address it is possible to access the web server on any remote PC by using its address, as in http://192.168.1.52

If a remote PC can be identified by name then you can use that instead of its address. You do not need any special sotfware for such a simple thing as this.
Tony Marston Send private email
Sunday, October 26, 2008
 
 
Tony,
I did say ".. using a URL instead of an IP address". The last thing I want is folks having to know IP addresses to access the server. And of course with DHCP, IP addresses can change.
Neville Franks Send private email
Sunday, October 26, 2008
 
 
If you want to use domain names instead of IP addresses ten you must have some way of relating a name to an IP address. The most common way of doing this on the Windows platform is to use the hosts file, but there needs to be a separate copy on each PC, and if the IP address changes then you must update everybody's hosts file.

As for dynamic addressing, this may be OK for PCs which access the web server, but the web server itself must have a static address.
Tony Marston Send private email
Monday, October 27, 2008
 
 
> I have a Windows application with an embedded web server

Isn't this a security risk?
coder
Tuesday, October 28, 2008
 
 
>> I have a Windows application with an embedded web server

>Isn't this a security risk?

Some would just call it a program.

Computer that don't open any ports at all would be pretty boring these days.
Lance Hampton Send private email
Tuesday, October 28, 2008
 
 
There is no need to open ports to use a web server locally.
Neville Franks Send private email
Tuesday, October 28, 2008
 
 

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics
 
Powered by FogBugz