M #~: fix cors sockets (#1267)

Co-authored-by: Jorge Lobo <jlobo@opennebula.systems>
This commit is contained in:
Jorge Miguel Lobo EscalonaandJorge Lobo authored and GitHub committed 2021-06-03 11:10:01 +02:00
1 parent fd0ebeffd3
commit 1561fcbfcd
3 files changed
+13 -3

No files matched your search

@@ -31,7 +31,17 @@ const websockets = (appServer = {}) => {
appServer.constructor.name &&
appServer.constructor.name === 'Server'
) {
const io = socketIO({ path: defaultEndpointWebsocket }).listen(appServer)
const io = socketIO(
{
path: defaultEndpointWebsocket,
cors: {
origin: '*',
methods: ['GET', 'POST'],
credentials: true
}
}
).listen(appServer)
defaultFilesWebsockets.forEach(file => {
try {
// eslint-disable-next-line global-require
+1 -1
View File
@@ -102,7 +102,7 @@ require.config({
"sprintf": "../bower_components/sprintf/dist/sprintf.min",
/* socket.io-client */
"socket-io-client": "../bower_components/socket.io-client/dist/socket.io.slim",
"socket-io-client": "../bower_components/socket.io-client/dist/socket.io.min",
/* ace editor */
"ace-builds": "../bower_components/ace-builds/ace"
+1 -1
View File
@@ -22,7 +22,7 @@
"guacamole-common-js": "https://github.com/OpenNebula/sunstone-deps.git#fe6e35b885",
"webauthn-json": "https://registry.npmjs.org/@github/webauthn-json/-/webauthn-json-0.4.1.tgz",
"wmks": "https://github.com/OpenNebula/sunstone-deps.git#cb0251c",
"socket.io-client": "~2.3.0",
"socket.io-client": "4.1.2",
"ace-builds": "https://github.com/OpenNebula/sunstone-deps.git#01ae12a"
},
"authors": [