在运行kurento_hello_world Nodejs教程时,Kurento客户端无法与运行在AWS上的kurento_hello_world连接。然而,相应的浏览器Javascript教程在完全相同的设置中工作得很好。
我的设置包括运行在EC2实例上的。这是使用服务器的公共可用CloudFormation配置来安装的。我已经正确配置了证书,并确保了浏览器对它们的信任。
我已经安装了教程,并从一个单独的EC2实例中运行。我正在使用6.10.0版本的教程(但是,我也使用6.9.0)。
我正在用Chrome测试这个。
对于浏览器JavaScript Hello教程,我更新了js/index.js文件,包括:
var args = getopts(location.search,
{
default:
{
// ws_uri: 'wss://' + location.hostname + ':8433/kurento',
ws_uri: 'wss://<IP_Of_KMS_On_AWS>:8433/kurento', // Kurento server on AWS
ice_servers: undefined
}
});这将导致本教程运行良好。我看到浏览器中的视频流和KMS日志文件中的日志。
对于教程,我更新了server.js文件,包括:
var argv = minimist(process.argv.slice(2), {
default: {
// as_uri: 'https://localhost:8443/',
as_uri: 'https://<IP_Of_Application_Server>:8443/', // Application server on EC2
// ws_uri: 'ws://localhost:8888/kurento'
ws_uri: 'wss://<IP_Of_KMS_On_AWS>:8433/kurento', // Kurento server on AWS
}
});在Node教程中,基本浏览器元素可以正常工作,但是应用程序无法成功地连接到KMS。我在KMS日志里什么都没看到。我看到浏览器中显示的本地视频,远程视频元素中有一个旋转器。这是我与其他Node教程类似的体验,即不调用AWS上的KMS实例。
我期望基于我的配置,Hello教程应该与浏览器Javascript教程一样工作,我应该看到浏览器中的视频流和在Kurento服务器上生成的日志。
公开问题: 1)我的配置看起来正确吗? 2)我在设置中遗漏了什么吗?
发布于 2020-06-04 11:04:16
我今天也面临着同样的问题。在使用Kurento设置ec2实例之后,我遵循了你好-世界nodejs教程中列出的步骤(更改了最后一步,明白为什么 ):
git clone https://github.com/Kurento/kurento-tutorial-node.git
cd kurento-tutorial-node/kurento-hello-world
git checkout 6.13.0
npm install
cd static
bower install --allow-root
cd ..
npm start -- --as_uri=https://0.0.0.0:8081/ npm start -- --ws_uri=ws://0.0.0.0:8888/kurento我在浏览器中看到了相同的行为:我可以看到本地流视频正在显示,但没有看到远程流,但与您不同,我在我的ec2终端中看到了这个日志:
/home/ubuntu/kurento-tutorial-node/kurento-hello-world/node_modules/express-session/index.js:142
if (req.session) return next();
^
TypeError: Cannot read property 'session' of undefined
at session (/home/ubuntu/kurento-tutorial-node/kurento-hello-world/node_modules/express-session/index.js:142:13)
at WebSocketServer.<anonymous> (/home/ubuntu/kurento-tutorial-node/kurento-hello-world/server.js:90:5)
at emitTwo (events.js:126:13)
at WebSocketServer.emit (events.js:214:7)
at handleUpgrade (/home/ubuntu/kurento-tutorial-node/kurento-hello-world/node_modules/ws/lib/websocket-server.js:90:18)
at WebSocketServer.completeUpgrade (/home/ubuntu/kurento-tutorial-node/kurento-hello-world/node_modules/ws/lib/websocket-server.js:329:5)
at WebSocketServer.handleUpgrade (/home/ubuntu/kurento-tutorial-node/kurento-hello-world/node_modules/ws/lib/websocket-server.js:245:10)
at Server.upgrade (/home/ubuntu/kurento-tutorial-node/kurento-hello-world/node_modules/ws/lib/websocket-server.js:89:16)
at emitThree (events.js:136:13)
at Server.emit (events.js:217:7)我发现这条线帮助我解决了这个问题。从线程中:
问题在于源代码使用的是一个旧版本的ws,自从编写代码以来,它已经删除了ws.upgradeReq。
我检查了GitHub页面中的server.js代码,发现if (req.session) return next();部件被更改了。我从我的ec2中删除了/kurento教程节点项目,并从hello-world nodejs教程中采取了所有步骤,但没有git checkout 6.13.0,以便获得新版本的代码。所以我做了:
git clone https://github.com/Kurento/kurento-tutorial-node.git
cd kurento-tutorial-node/kurento-hello-world
npm install
cd static
bower install --allow-root
cd ..
npm start -- --as_uri=https://0.0.0.0:8081/ npm start -- --ws_uri=ws://0.0.0.0:8888/kurento这一次起作用了

https://stackoverflow.com/questions/55543158
复制相似问题