make the service example work

issue #98 requires connecting to localhost (which `hostname` may resolve to) will not work.