Fixed https
This commit is contained in:
parent
79fafa466b
commit
7ea764730b
@ -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
|
||||
|
||||
|
@ -45,7 +45,7 @@
|
||||
<div id="counter-container">
|
||||
<span>Nombre de fans connectés : <span id="value">x</span></span>
|
||||
</div>
|
||||
<script src="http://danby.aniere.fr:3000/socket.io/socket.io.js"></script>
|
||||
<script src="https://danby.aniere.fr:3000/socket.io/socket.io.js"></script>
|
||||
<script src="https://unpkg.com/swiper@8/swiper-bundle.min.js"></script>
|
||||
<script src="script.js"></script>
|
||||
</body>
|
||||
|
Loading…
Reference in New Issue
Block a user