Fix to make library to work in local subnet.

Redmine issue: #540

Sorry that I deleted the previous forked repository. I didn't realise that all the comments under previous pull request will be deleted. I needed to redone pull request in order that we wouldn't lose most recent commits from your repository.

So in order to see this fix in process you need to connect at least two devices into same network. My personal setup was that I had DNS server, EmonCMS website server and Nanode with your library all in the same network and originally it wasn't working. With this fix it works now. It is sufficient for you to create website server on your computer and connect that computer to the same network as Nanode. That should be manageable with home router and single ethernet cable for Nanode. Of course it doesn't have to be Nanode, you can use any device which uses your library. 

I think this fix would solve other few issues reported in redmine.