Skip to content

Commit

Permalink
feat: Set up CORS for wss server
Browse files Browse the repository at this point in the history
  • Loading branch information
Yongbeom-Kim committed Nov 13, 2024
1 parent 91e0eb8 commit 0458da2
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion peerprep/backend/collab-service/src/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,13 @@ if (process.env.SSL_KEY_PATH && process.env.SSL_CERT_PATH && process.env.SSL_CA_
console.log('HTTP server created as SSL/TLS certificates are not provided.');
}

const wss = new WebSocket.Server({ server });
const wss = new WebSocket.Server({
server,
verifyClient: (info, done) => {
// Allow connections from any origin
done(true);
}
});

app.use(cors());
app.use(express.json());
Expand Down

0 comments on commit 0458da2

Please sign in to comment.