如何使用不同的RoomID在特定的URL处进行插座设置?
我是插座的新手,试图设置一个实时流媒体网站,我需要您的帮助来设置我面临的问题。
我想为实时流创建多个房间,而我的初始终点是/api/livestream
我想要的类似于Google Meet /api/liveStream/roomid
,
// Routes
app.use("/api/messages", messageRoutes);
app.get("/api/liveStream", (req, res) => {
var roomid = uuidV4();
res.redirect("api/liveStream/" + roomid);
});
// Server listner
const liveStream_io = io.of("/api/liveStream/:id");
liveStream_io.on("connection", liveStream.listen);
server.listen(process.env.PORT, () =>
console.log(`Server started on ${process.env.PORT}`)
);
您在此代码中看到的是,我将用户重定向到直播。 现在创建的侦听函数
我的根本混乱是如何获得ID,这是配置流的正确方法
I am new to Sockets and trying to set up a Live Streaming website, and I need your help to set up the problems I am facing.
I want to create multiple rooms for live stream, and my initial endpoint is /api/livestream
what I want is similar to google meet /api/livestream/roomid
// Routes
app.use("/api/messages", messageRoutes);
app.get("/api/liveStream", (req, res) => {
var roomid = uuidV4();
res.redirect("api/liveStream/" + roomid);
});
// Server listner
const liveStream_io = io.of("/api/liveStream/:id");
liveStream_io.on("connection", liveStream.listen);
server.listen(process.env.PORT, () =>
console.log(`Server started on ${process.env.PORT}`)
);
As you can see in this code, I am redirecting the user to livestream. listen function created
now my fundamental confusion is how can I get the id and is this the right way to configure the stream
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论