Use hostname instead of localhost for socket connection