Error: isAdminAuthorized is not defined
opened this issue · comments
Muaz, today I decided to update the project. The server has started, but it is impossible to enter the administration panel. What could be the reason?
Installation Guide https://github.com/muaz-khan/RTCMultiConnection/blob/master/docs/installation-guide.md#install-using-npm-or-bower
sudo apt-get update
sudo apt-get upgrade
wget https://github.com/muaz-khan/RTCMultiConnection/archive/master.zip
unzip master.zip
cd RTCMultiConnection-master
npm install --production
Modify config.json
: homePage, port, sslKey, sslCert etc and "enableAdmin": "true"
.
And then run node server.js
Server is working fine. I can load https://domenName:443/socket.io/socket.io.js . Console log:
Socket.io is listening at:
https://localhost:443/
Your web-browser (HTML file) MUST set this line:
connection.socketURL = "https://localhost:443/";
Admin page is enabled and running on: https://localhost:443/admin/
Admin page username: adminuser
Admin page password: 34r34fv5gh56jh5jyh54er
For more help: node server.js --help
But when I try to go to the Admin page https://domenName:443/admin/ The server issues this message:
404 Not Found: Unexpected error.
isAdminAuthorized is not defined
ReferenceError: isAdminAuthorized is not defined
at /home/dd/videochat/RTCMultiConnection-master/server.js:80:13
at Server.serverHandler (/home/dd/videochat/RTCMultiConnection-master/node_modules/rtcmulticonnection-server/node_scripts/index.js:48:13)
at Server.<anonymous> (/home/dd/videochat/RTCMultiConnection-master/node_modules/engine.io/lib/server.js:471:22)
at Server.<anonymous> (/home/dd/videochat/RTCMultiConnection-master/node_modules/socket.io/lib/index.js:343:16)
at Server.emit (events.js:182:13)
at parserOnIncoming (_http_server.js:657:12)
at HTTPParser.parserOnHeadersComplete (_http_common.js:109:17)
Ubuntu 16.04.5 LTS
node -v
v11.0.0
nodejs -v
v10.13.0npm
npm -v
6.4.1
Thank you, Muaz.
I deleted the node_modules
folder on the server and reinstalled all dependencies
npm install --production
When I try to access the admin panel, the server shows the same error.
Sometimes node server.js
process strongly loads the processor. Perhaps Node.js v11.0.0 is not stable. I will try to make a downgrade to watch the CPU load
Are you using server.js
from RTCMultiConnection directory?
You should modify config.json
from same directory: (for enableAdmin:true
)
When you run node server.js
does it shows the admin page link?
You can try this: (to validate latest NPM installation)
node
var json = require('./node_modules/rtcmulticonnection-server/package.json');
json.version;
Or maybe npm list
.
yes,
Im using last server.js
from RTCMultiConnection directory and config.json
from same directory: (for enableAdmin:true
)
After I start the server node server.js
(in the same directory) I cannot get to the admin page.
node
var json = require('./node_modules/rtcmulticonnection-server/package.json');
json.version;
I have a new version: '1.2.7'
I created a new server. Made a subdomain. Generated new SSL certificates. Raised & setup Coturn STUN / TURN server. Installed RTCMultiConnection and used demos Multi-Broadcasters-and-Many-Viewers.html for the test.
The admin panel opens! But after authorization, a cyclic reboot is enabled. Chrome Console: Active Resource loading limit Network requests will be delayed until it’s financed. See https://www.chromestatus.com/feature/5527160148197376 for more details
Later, the panel begins to work. In the admin panel log error:
invalid-admin Invalid username or password attempted
Without any UserName or Password. But after some time after the start of the application, one processor is loaded at 100% and the application stops responding. The cpu doesn’t drop until node server.js is restarted.
On a virtual server, two Intel (R) Xeon (R) CPU E5-2673 v4 @ 2.30GHz processors.
Server Settings:
node -v
v11.1.0
npm -v
6.4.1
Temporary solution. I did a downgrade rtcmulticonnection-server
to version '1.0.5'.
I unpacked the previously downloaded rtcmulticonnection-server
version '1.0.5' archive and replaced them with all the files in the RTCMultiConnection/node_modules/rtcmulticonnection-server/
In the folder RTCMultiConnection/admin/
replaced all files from the version '3.5.3' archive. (With the file /admin/index.html <! - Demo version: 2018.10.15 ->)
The load on the processor is almost zero. The service is now stable.
I created another server. There your code has earned and does not load the processor. The point is not in your code, but in the settings of the server software. Honestly, I did not understand what the problem was. Like the version, maybe the new servers on the Azure cloud slowly install updates and because of this there is a conflict that overloads the processor.