websocket https
This commit is contained in:
parent
49cc7930d3
commit
e181c4044d
@ -1,5 +1,5 @@
|
||||
const WebSocket = require('ws');
|
||||
var http = require('http');
|
||||
var https = require('https');
|
||||
|
||||
var websocket_port = 8888;
|
||||
const wss = new WebSocket.Server({port: websocket_port});
|
||||
@ -11,7 +11,10 @@ wss.on('connection', function connection(ws) {
|
||||
lookup[ws.protocol] = ws;
|
||||
});
|
||||
|
||||
var server = http.createServer(function (request, response) {
|
||||
var server = https.createServer({
|
||||
cert: fs.readFileSync('/etc/letsencrypt/live/atcheck.projektstudencki.pl/fullchain.pem'),
|
||||
key: fs.readFileSync('/etc/letsencrypt/live/atcheck.projektstudencki.pl/key.pem')
|
||||
}, function (request, response) {
|
||||
response.writeHead(200, {"Content-Type": "text\plain"});
|
||||
request.setEncoding('utf8');
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user