Changes JavaScript to dynamically insert domain into ws request.