make the service example work

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