Skip to content

Commit 01a9c99

Browse files
committed
Convert to .mjs, remove debugging output
1 parent aea330d commit 01a9c99

File tree

3 files changed

+15
-13
lines changed

3 files changed

+15
-13
lines changed

package-lock.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
{
22
"name": "tarkov-socket-server",
3-
"version": "1.0.0",
3+
"version": "2.0.0",
44
"description": "",
5-
"main": "server.js",
5+
"main": "server.mjs",
66
"scripts": {
77
"test": "echo \"Error: no test specified\" && exit 1",
8-
"start": "node server.js",
9-
"dev": "nodemon server.js"
8+
"start": "node server.mjs",
9+
"dev": "nodemon server.mjs"
1010
},
1111
"repository": {
1212
"type": "git",
13-
"url": "git+https://github.com/kokarn/tarkov-socket-server.git"
13+
"url": "git+https://github.com/the-hideout/tarkov-socket-server.git"
1414
},
1515
"keywords": [],
1616
"author": "",
1717
"license": "ISC",
1818
"bugs": {
19-
"url": "https://github.com/kokarn/tarkov-socket-server/issues"
19+
"url": "https://github.com/the-hideout/tarkov-socket-server/issues"
2020
},
21-
"homepage": "https://github.com/kokarn/tarkov-socket-server#readme",
21+
"homepage": "https://github.com/the-hideout/tarkov-socket-server#readme",
2222
"dependencies": {
2323
"ws": "^8.17.0",
2424
"dotenv": "^16.4.5"

server.js server.mjs

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
require('dotenv').config();
2-
const WebSocket = require('ws');
1+
import dotenv from 'dotenv';
2+
import WebSocket, { WebSocketServer } from 'ws';
33

4-
const wss = new WebSocket.Server({
4+
dotenv.config();
5+
6+
const wss = new WebSocketServer({
57
port: process.env.PORT || 8080,
68
});
79

@@ -39,7 +41,7 @@ wss.on('connection', (ws, req) => {
3941
ws.sessionID = url.searchParams.get('sessionid');
4042

4143
if (!ws.sessionID) {
42-
console.log('Terminating connecting client missing sessionID');
44+
//console.log('Terminating connecting client missing sessionID');
4345
ws.terminate();
4446
return;
4547
}

0 commit comments

Comments
 (0)