Dynamically build hostname for websocket

- avoid hostname issues between environments