zoom : socket.io - admin-ui
This commit is contained in:
917
zoom/package-lock.json
generated
917
zoom/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -14,6 +14,7 @@
|
||||
"nodemon": "^2.0.13"
|
||||
},
|
||||
"dependencies": {
|
||||
"@socket.io/admin-ui": "^0.2.0",
|
||||
"express": "^4.17.1",
|
||||
"pug": "^3.0.2",
|
||||
"socket.io": "^4.3.0",
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import http from "http";
|
||||
import SocketIo from "socket.io";
|
||||
import { Server } from "socket.io";
|
||||
import { instrument } from "@socket.io/admin-ui";
|
||||
import express, { application } from "express";
|
||||
|
||||
const app = express();
|
||||
@@ -14,7 +15,16 @@ app.get("/*", (req, res) => res.redirect("/"));
|
||||
const handleListen = () => console.log(`Listening on http://localhost:3000`);
|
||||
|
||||
const httpServer = http.createServer(app);
|
||||
const wsServer = SocketIo(httpServer);
|
||||
const wsServer = new Server(httpServer, {
|
||||
cors: {
|
||||
origin: ["https://admin.socket.io"],
|
||||
credentials: true,
|
||||
},
|
||||
});
|
||||
|
||||
instrument(wsServer, {
|
||||
auth: false,
|
||||
});
|
||||
|
||||
function publicRooms() {
|
||||
const {sockets: {adapter: {sids, rooms}}} = wsServer;
|
||||
|
||||
Reference in New Issue
Block a user