systemlynx 1.18.11 → 1.18.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -43,7 +43,13 @@ module.exports = function createServerManager(customServer) {
|
|
|
43
43
|
const httpServer = ssl ? https.createServer(ssl, server) : http.createServer(server);
|
|
44
44
|
const socketPath = `/${route}/socket.io`;
|
|
45
45
|
|
|
46
|
-
const WebSocket = socketIO(httpServer, {
|
|
46
|
+
const WebSocket = socketIO(httpServer, {
|
|
47
|
+
path: socketPath,
|
|
48
|
+
cors: {
|
|
49
|
+
origin: "*",
|
|
50
|
+
methods: ["GET", "POST"],
|
|
51
|
+
},
|
|
52
|
+
});
|
|
47
53
|
|
|
48
54
|
SocketEmitter.apply(ServerManager, [route, WebSocket]);
|
|
49
55
|
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
module.exports = function createWebSocket(path) {
|
|
2
2
|
const express = require("express");
|
|
3
3
|
const SocketServer = require("http").Server(express());
|
|
4
|
-
const WebSocket = require("socket.io")(SocketServer, {
|
|
4
|
+
const WebSocket = require("socket.io")(SocketServer, {
|
|
5
|
+
path,
|
|
6
|
+
cors: {
|
|
7
|
+
origin: "*", // Or your specific origin
|
|
8
|
+
methods: ["GET", "POST"],
|
|
9
|
+
},
|
|
10
|
+
});
|
|
5
11
|
|
|
6
12
|
return { WebSocket, SocketServer };
|
|
7
13
|
};
|