dynamic urls for api/websockets based on window.location.host/protocol