Skip to content

Commit 61f3914

Browse files
committed
fix v4-ws-ssl-err.js to allow start service
1 parent e8213d5 commit 61f3914

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

tests/socket.io/v4/v4-ws-ssl-err.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,17 @@
33
const https = require('https');
44
const socket = require('socket.io');
55
const fs = require('fs');
6+
const path = require('path');
67

78
const server = https.createServer({
8-
key: fs.readFileSync('cert/private.key'),
9-
cert: fs.readFileSync('cert/cert.crt')
9+
key: fs.readFileSync(path.join(__dirname, 'cert', 'private.key')),
10+
cert: fs.readFileSync(path.join(__dirname, 'cert', 'cert.crt'))
1011
}, (req, res) => {
1112
if (req.method === 'GET' && req.url === '/hello') {
1213
res.end('Hello World!\n');
1314
}
1415
});
15-
const port = process.env.PORT || 11404;
16+
const port = 11404;
1617

1718
var io = socket(server, {
1819
pingInterval: 5000,

0 commit comments

Comments
 (0)