testing secure websocket
This commit is contained in:
Binary file not shown.
Before Width: | Height: | Size: 119 KiB |
Binary file not shown.
Before Width: | Height: | Size: 234 KiB |
@@ -1 +0,0 @@
|
|||||||
cnm,<2C><><EFBFBD><EFBFBD>
|
|
4
src/sec_certs/server.crt
Normal file
4
src/sec_certs/server.crt
Normal 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
4
src/sec_certs/server.key
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
-----BEGIN RSA PRIVATE KEY-----
|
||||||
|
this is a fake placeholder ;)
|
||||||
|
place your file here
|
||||||
|
-----END RSA PRIVATE KEY-----
|
@@ -2,6 +2,12 @@
|
|||||||
function webServer() {
|
function webServer() {
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const WebSocket = require('ws');
|
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({
|
const wss = new WebSocket.Server({
|
||||||
port: 8989
|
port: 8989
|
||||||
}, () => {
|
}, () => {
|
||||||
|
Reference in New Issue
Block a user