mirror of https://github.com/bra1n/townsquare.git
Merge pull request #241 from bra1n/develop
fixed local server (closes #240)
This commit is contained in:
commit
885414a5a1
|
@ -12,10 +12,14 @@ register.setDefaultLabels({
|
||||||
|
|
||||||
const PING_INTERVAL = 30000; // 30 seconds
|
const PING_INTERVAL = 30000; // 30 seconds
|
||||||
|
|
||||||
const server = https.createServer({
|
const options = {};
|
||||||
cert: fs.readFileSync("cert.pem"),
|
|
||||||
key: fs.readFileSync("key.pem")
|
if (process.env.NODE_ENV !== "development") {
|
||||||
});
|
options.cert = fs.readFileSync("cert.pem");
|
||||||
|
options.key = fs.readFileSync("key.pem");
|
||||||
|
}
|
||||||
|
|
||||||
|
const server = https.createServer(options);
|
||||||
const wss = new WebSocket.Server({
|
const wss = new WebSocket.Server({
|
||||||
...(process.env.NODE_ENV === "development" ? { port: 8081 } : { server }),
|
...(process.env.NODE_ENV === "development" ? { port: 8081 } : { server }),
|
||||||
verifyClient: info =>
|
verifyClient: info =>
|
||||||
|
@ -234,7 +238,7 @@ const interval = setInterval(function ping() {
|
||||||
ws.readyState === WebSocket.CONNECTING)
|
ws.readyState === WebSocket.CONNECTING)
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
metrics.channels_list.remove([channel]);
|
metrics.channels_list.remove({ name: channel });
|
||||||
delete channels[channel];
|
delete channels[channel];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
class LiveSession {
|
class LiveSession {
|
||||||
constructor(store) {
|
constructor(store) {
|
||||||
this._wss = "wss://live.clocktower.online:8080/";
|
this._wss = "wss://live.clocktower.online:8080/";
|
||||||
//this._wss = "wss://localhost:8081/";
|
// this._wss = "ws://localhost:8081/"; // uncomment if using local server with NODE_ENV=development
|
||||||
this._socket = null;
|
this._socket = null;
|
||||||
this._isSpectator = true;
|
this._isSpectator = true;
|
||||||
this._gamestate = [];
|
this._gamestate = [];
|
||||||
|
|
Loading…
Reference in New Issue