[mirotalk] - change port from .env

This commit is contained in:
Miroslav Pejic
2022-06-17 21:23:30 +02:00
parent 586785472d
commit 53e7e07f59
3 changed files with 11 additions and 15 deletions
+4
View File
@@ -1,3 +1,7 @@
# Signaling Server listen port
PORT=3000
# Ngrok
# 1. Goto https://ngrok.com
# 2. Get started for free
+4 -1
View File
@@ -15,4 +15,7 @@ package-lock.json
.cache
# personal env
.env
.env
# personal doc
doc
+3 -14
View File
@@ -21,7 +21,6 @@
'use strict'; // https://www.w3schools.com/js/js_strict.asp
const isHttps = false; // must be the same on server.js
const signalingServerPort = 3000; // must be the same to server.js PORT
const signalingServer = getSignalingServer();
const roomId = getRoomId();
const peerInfo = getPeerInfo();
@@ -535,16 +534,9 @@ function getPeerGeoLocation() {
*/
function getSignalingServer() {
if (isHttps) {
return 'https://' + location.hostname + ':' + signalingServerPort;
// if need: change it with YOUR-SERVER-DOMAIN-NAME
return 'https://' + location.hostname;
}
return (
'http' +
(location.hostname == 'localhost' ? '' : 's') +
'://' +
location.hostname +
(location.hostname == 'localhost' ? ':' + signalingServerPort : '')
);
return 'http' + (location.hostname == 'localhost' ? '' : 's') + '://' + location.hostname;
}
/**
@@ -650,12 +642,9 @@ function initClientPeer() {
}
console.log('Connecting to signaling server');
//signalingSocket = io(signalingServer);
// Disable the HTTP long-polling transport
signalingSocket = io(signalingServer, {
transports: ['websocket'],
});
signalingSocket = io({ transports: ['websocket'] });
const transport = signalingSocket.io.engine.transport.name; // in most cases, "polling"
console.log('Connection transport', transport);