diff --git a/backend/index.js b/backend/index.js index 59c85c8..966317e 100644 --- a/backend/index.js +++ b/backend/index.js @@ -1,9 +1,23 @@ -const express = require("express"); - +const fs = require('fs'); +const https = require('https'); +const express = require('express'); +const socketio = require('socket.io'); const app = express(); -const http = require("http"); -const server = http.createServer(app); -const io = require("socket.io")(server); + +const https_options = { + key: fs.readFileSync('./privkey.pem'), + cert: fs.readFileSync('./fullchain.pem'), + requestCert: false, + rejectUnauthorized: false +} +const server = https.createServer(https_options, app); + +const io = socketio(server, { + cors: { + origin: "https://danby.aniere.fr", + }, + secure: true +}); usersConnected = 0 diff --git a/index.html b/index.html index e1b1ef8..5f03121 100644 --- a/index.html +++ b/index.html @@ -45,7 +45,7 @@