I am trying to run a HTTP server in my LAN and want to access it by using a browser on another desktop machine. As I do not like typing the IP address and port manually I tried setting up a mDNS using jmDNS.
String type = "_http._tcp.local.";
jmdns = JmDNS.create();
jmdns.addServiceListener(type, listener = new ServiceListener() {
@Override
public void serviceResolved(ServiceEvent ev) {
Log.d(LogTag.SERVER, "Service resolved: " + ev.getInfo().getQualifiedName() + " port:"
+ ev.getInfo().getPort());
}
@Override
public void serviceRemoved(ServiceEvent ev) {
Log.d(LogTag.SERVER, "Service removed: " + ev.getName());
}
@Override
public void serviceAdded(ServiceEvent event) {
// Required to force serviceResolved to be called again (after the first search)
jmdns.requestServiceInfo(event.getType(), event.getName(), 1);
}
});
serviceInfo = ServiceInfo.create(type, NAME, PORT, "test service");
jmdns.registerService(serviceInfo);
The mDNS entry shows up on ZeroConf Browser app just fine. The server is reachable by IP and port just fine.
On Windows 7 typing the name with the .local TLD (= http://roseblade.local/) into any address bar (Firefox, Chrome, Safari, IE) does not do much and from what my research shows is pretty much a futile task anyway. I installed Apple Bonjour but that only help running Hobbyist Software's Bonjour Browser. As far as Linux goes I tried the same with elemantaryOS and Midori but that also did not work. OSX or iOS is currently not available to me.
How can I get the resolution of the .local address to work in my browser (Firefox, Chrome, whatever on Linux, OSX or Windows7)? Am I doing something wrong? At this point I would just like to verify that mDNS can work like that on a system.
Pointers to material on the issue are also appreciated.