InstantWebP2P/peer-vnc

TypeError: One of the "port", "server", or "noServer" options must be specified

mloeffler-nc opened this issue · 1 comments

Greetings,

I'm trying to use your VNC Proxy. I compiled nodejs-httpp and installed peer-vnc over npm (version 3.3.3 "latest")

When trying to add a new proxy with

let x = new _Proxy(['localhost:5900'], function(err, proxyURL){
console.log('VNC                   Proxy URL(please open it on browser)');
    for (var k in proxyURL) {
        console.log(k+'        '+proxyURL[k]);
    }
});

x.addVNC({
   host: "192.168.1.3",
   port: 5009
})

I get the following error:

ven@nc-L580-malo:~/Projekte/peer-vnc/own$ /opt/nodejs-httpp/node src/test.js
/home/ven/Projekte/peer-vnc/own/node_modules/wspp/lib/websocket-server.js:59
      throw new TypeError(
      ^

[TypeError: One of the "port", "server", or "noServer" options must be specified
  at new WebSocketServer (/home/ven/Projekte/peer-vnc/own/node_modules/wspp/lib/websocket-server.js:59:13)
  at module.exports.Proxy.addVNC (/home/ven/Projekte/peer-vnc/own/node_modules/peer-vnc/index.js:199:18)
  at Object.<anonymous> (/home/ven/Projekte/peer-vnc/own/src/test.js:34:3)
  at Module._compile (internal/modules/cjs/loader.js:999:30)
  at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
  at Module.load (internal/modules/cjs/loader.js:863:32)
  at Function.Module._load (internal/modules/cjs/loader.js:708:14)
  at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)
  at internal/main/run_main_module.js:17:47
]

I tried debugging and got to the conclusion, that self.nmcln.bsrv in line 199 is an empty object.

    ...
    // 1.
    // create ws server to proxy VNC/RFB data
    var vncstr = vnc.host+':'+vnc.port;
    var wspath = '/'+vnc.host+'-'+vnc.port;
    // self.nmcln.bsrv is {}
    var vncwss = new WebSocketServer({httpp: true, server: self.nmcln.bsrv.srv, path: wspath});
    
    vncwss.on('connection', noVNC.tcpProxy({host: vnc.host, port: vnc.port}));
   ...

I can't seem to fix this problem for days

@mloeffler-nc need to setup your own appnet.link-controller server firstly.

https://github.com/InstantWebP2P/appnet.link-controller