Problems moving server_example

78 views
Skip to first unread message

Ian Hobson

unread,
May 18, 2017, 2:43:25 PM5/18/17
to EasyRTC

Hi Everyone,
New to easyrtc, webRTC, node.js. Please be gentle.

I am trying to put the switching server within the URI space of an existing website, which means moving the source files to a new location. (And then using nginx as a proxy). Not got that far yet.

I read  *\easyrtc\server_example\README.md which tells me it is possible to move the server, and gives me the steps to follow. But...

When I run "npm install" I am told a lot of the software is deprecated due to DOS attack possibilities. ???

Google tells me that I should run the following three commands to bring things up to date.
npm i -g npm-check-updates
npm-check-updates -u
npm install

Which I do. Then when I start the server I get this:-

ian@thebe:~/websites/coachmaster3dev/easyrtc/server$ node server
module.js:471
throw err;
^

Error: Cannot find module '../'
at Function.Module._resolveFilename (module.js:469:15)
at Function.Module._load (module.js:417:25)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/home/ian/websites/coachmaster3dev/easyrtc/server/server.js:6:15)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
ian@thebe:~/websites/coachmaster3dev/easyrtc/server$

What is wrong? Why is it looking in the parent directory if I can place it anywhere?

Why does it install out of date software?

As part of my investigations, I went back to the original location, followed the instructions and everything worked?????

So I moved things again, followed instructions very carefully, and got the same error.

Thanks for your input.

Ian

Eric Davies

unread,
May 19, 2017, 4:39:26 PM5/19/17
to EasyRTC
as for moving the files:
   if you look in the server.js, it has the line
         var easyrtc = require("../")
  It has to be able to find that package somehow. There is no magic.
  If you want to move that package else, you need to update that path. 

As for "out-of-date" dependencies: feel free to try removing the version constraints from the package.json and see if it still works.
Those packages were current when it was written, and we know that they'll work with them. Remove the constraints and things will of course fail if any api's have changed.


Ian Hobson

unread,
May 22, 2017, 6:58:44 AM5/22/17
to EasyRTC
Thanks Eric,

I have made progress. Code works with latest versions but...

I have 2 cameras and two microphones, so I tried to test using two browsers (Firefox and Chrome) on the same machine.

I always get my own video, sometimes neither video works, sometimes only one side connects up, and sometimes both work fine. ????

One time, whe it worked, I got a list of bad ice candidate messages on screen also, that appear to be rejecting all the incorrect ports/IPs on my machine. Not a surprise and probably correct.

As soon as I move the server out on the the web, I get  NOVALIDICE errors from both browsers, always.

The ICE servers I am using are:
option.appIceServers = [                                 
 // Array of STUN and TURN servers. By default there are only publicly available STUN servers.
    {urls: "stun:stun.l.google.com:19302"}
    ,{urls: "stun:stun.sipgate.net"}
    ,{urls: "stun:217.10.68.152"}
    ,{urls: "stun:stun.sipgate.net:10000"}
    ,{urls: "stun:217.10.68.152:10000"}
];


Ideas? I'm stumped.
Ian
Reply all
Reply to author
Forward
0 new messages