What is the correct way to structure a websocket connection within a React app where the socket port is loaded via a RESTful call on page load?