testing secure websocket

This commit is contained in:
2022-10-11 17:51:52 +02:00
parent 2e16cc84c2
commit 138ebfb84d
6 changed files with 14 additions and 1 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 119 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 234 KiB

View File

@@ -1 +0,0 @@
cnm,<2C><><EFBFBD><EFBFBD>

4
src/sec_certs/server.crt Normal file
View File

@@ -0,0 +1,4 @@
-----BEGIN CERTIFICATE-----
this is a fake placeholder ;)
place your file here
-----END CERTIFICATE-----

4
src/sec_certs/server.key Normal file
View File

@@ -0,0 +1,4 @@
-----BEGIN RSA PRIVATE KEY-----
this is a fake placeholder ;)
place your file here
-----END RSA PRIVATE KEY-----

View File

@@ -2,6 +2,12 @@
function webServer() {
const fs = require('fs');
const WebSocket = require('ws');
const https = require('https');
const server = new https.createServer({
cert: fs.readFileSync('./sec_certs/server.crt'),
key: fs.readFileSync('./sec_certs/server.key')
});
const wss = new WebSocket.Server({
port: 8989
}, () => {