When working on my page, I establish a websocket connection to the server using ws://127.0.0.1:5000/ws in development and ws://www.mymachine.com/ws when deployed to production. Is there a more efficient way to handle this so that I don't have to manually adjust the URI from 127.0.0.1:5000 to www.mymachine.com every time I deploy?
I attempted to use ws://ws
but it was unsuccessful. My goal is to achieve similar functionality as a standard URL where you can simply use /index
and be directed to either 127.0.0.1:5000/index or www.mymachine.com/index based on the environment it is running in.