1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-21 14:50:08 +03:00

M #~: fix cors sockets (#1267)

Co-authored-by: Jorge Lobo <jlobo@opennebula.systems>
This commit is contained in:
Jorge Miguel Lobo Escalona 2021-06-03 11:10:01 +02:00 committed by GitHub
parent fd0ebeffd3
commit 1561fcbfcd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 3 deletions

View File

@ -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

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"

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": [