I have a page that open a websocket connection back to the server. The websocket server is ws://127.0.0.1:5000/ws when in development and ws://www.mymachine.com/ws when deployed to production. Is there a short hand for this, so I don't have to re-write this URI manually from 127.0.0.1:5000
to www.mymachine.com
when I deploy?
I've tried ws://ws
but it doesn't work. I'm trying to get the same behavior as a normal url where you can use /index
and it will go to 127.0.0.1:5000/index or www.mymachine.com/index depending on where it is running.