Skip to content

Commit dc9d010

Browse files
authored
fix(electron): enable CORS for socket.io server (fix #1813) (#1815)
1 parent 9606ae3 commit dc9d010

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/shell-electron/server.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@ const { Server } = require('socket.io')
77
const port = process.env.PORT || 8098
88

99
const httpServer = createServer(app)
10-
const io = new Server(httpServer, {})
10+
const io = new Server(httpServer, {
11+
cors: {
12+
origin: true,
13+
},
14+
})
1115

1216
app.get('/', function (req, res) {
1317
const hookContent = fs.readFileSync(path.join(__dirname, '/build/hook.js'), 'utf8')

0 commit comments

Comments
 (0)