blob: 9bc77aa3264a157f3da9e37504febfe8563d40bb [file] [log] [blame]
// The file including this must also include ../websocket.sub.js to pick up the
// necessary constants.
const {BASEURL, ECHOURL} = (() => {
const isSecure = location.href.match(/^https:/);
const scheme = isSecure ? "wss:" : "ws:";
const port = isSecure ? __SECURE__PORT : __PORT;
const BASEURL = `${scheme}//${__SERVER__NAME}:${port}`;
const ECHOURL = `${BASEURL}/echo`;
return {BASEURL, ECHOURL};
})();