我写了以下代码:
var http = require("http"); // http server core module
var express = require("express"); // web framework external module
var io = require("socket.io"); // web socket external module
var easyrtc = require("easyrtc"); // EasyRTC external module
var app = express();
var server = http.createServer(app).listen(app.get('port'));
io= io.listen(server,{"log level":1});
var rtc = easyrtc.listen(server, io);
这会产生以下错误:
$ node server info - EasyRTC:启动EasyRTC Server(v1.0.10) 节点(v0.10.26)[TypeError:对象#没有方法'get'] TypeError:Object#没有方法'get' at async.waterfall.pub.socketServer.sockets.on.easyrtcid(/ home / ritzy1 / Downloads / downloads 码/ VEDIO / change2 / testexpandwb / node_modules / easyrtc / LIB / easyrtc_default_event_listeners.js:1472:29) at fn(/ home / ritzy1 / Downloads / downloads codes / VEDIO / change2 / testexpandwb / node_modules / easyrtc / node_modules / async / lib / async.js:582:34) at Object._onImmediate(/ home / ritzy1 / Downloads / downloads codes / VEDIO / change2 / testexpandwb / node_modules / easyrtc / node_modules / async / lib / async.js:498:34) at processImmediate [as _immediateCallback](timers.js:330:15)
我可以解决它吗?
答案 0 :(得分:1)
您必须在listen()函数中提供特定的端口号。
更改以下行var server = http.createServer(app).listen(app.get('port'));
与
var server = http.createServer(app).listen(8080);
注意:8080是一个端口号,您可以指定当前未使用的任何其他端口号
快乐编码