它在本地主机上的 Chrome 下运行良好。(Firefox 存在问题,希望使用 HTTPS 远程运行会使问题消失。但这与这个问题无关。)
我使用 AWS 控制台打开了 readme.MD 上指定的端口(入站 TCP 到端口 3000,入站 UDP 到端口 40000-49999,允许所有传出流量。)
然后将 config.json 改编为:
module.exports = {
// http server ip, port, and peer timeout constant
//
httpIp: "0.0.0.0",
httpPort: 3000,
httpPeerStale: 15000,
// ssl certs. we'll start as http instead of https if we don't have
// these
sslCrt: "local.crt",
sslKey: "local.key",
mediasoup: {
worker: {
rtcMinPort: 40000,
rtcMaxPort: 49999,
logLevel: "debug",
logTags: [
"info",
"ice",
"dtls",
"rtp",
"srtp",
"rtcp",
// 'rtx',
// 'bwe',
// 'score',
// 'simulcast',
// 'svc'
],
},
router: {
mediaCodecs: [
{
kind: "audio",
mimeType: "audio/opus",
clockRate: 48000,
channels: 2,
},
{
kind: "video",
mimeType: "video/VP8",
clockRate: 90000,
parameters: {
// 'x-google-start-bitrate': 1000
},
},
{
kind: "video",
mimeType: "video/h264",
clockRate: 90000,
parameters: {
"packetization-mode": 1,
"profile-level-id": "4d0032",
"level-asymmetry-allowed": 1,
// 'x-google-start-bitrate' : 1000
},
},
{
kind: "video",
mimeType: "video/h264",
clockRate: 90000,
parameters: {
"packetization-mode": 1,
"profile-level-id": "42e01f",
"level-asymmetry-allowed": 1,
// 'x-google-start-bitrate' : 1000
},
},
],
},
// rtp listenIps are the most important thing, below. you'll need
// to set these appropriately for your network for the demo to
// run anywhere but on localhost
webRtcTransport: {
listenIps: [
{ ip: "172.3.-.-", announcedIp: "18.255.8.87" },
// { ip: "192.168.42.68", announcedIp: null },
// { ip: '10.10.23.101', announcedIp: null },
],
initialAvailableOutgoingBitrate: 800000,
},
},
};
(一段时间后,Chrome 的控制台显示mediasoup-client:Transport connection state changed to disconnected +17s
)
在我看来,好像我需要打开一两个额外的端口,但我不确定是哪一个。
我将非常感谢一些帮助。先感谢您... :)