server https

This commit is contained in:
Killian Marty 2023-12-08 13:53:44 +01:00
parent b12548d46b
commit c2b0cf43d7

View file

@ -1,11 +1,13 @@
const express = require('express');
const http = require('http');
const https = require('https').createServer;
const WebSocket = require('ws');
const url = require('url');
const objectsModule = require('./objects');
const fs = require('fs');
const app = express();
const server = http.createServer(app);
const server = https({
cert: fs.readFileSync("/etc/letsencrypt/live/ws.gta6.insat.fr/cert.pem"),
key: fs.readFileSync("/etc/letsencrypt/live/ws.gta6.insat.fr/privkey.pem")
});
const wss = new WebSocket.Server({
server
});