wisp-server-node
Advanced tools
Comparing version 1.1.3 to 1.1.4
@@ -38,2 +38,3 @@ "use strict"; | ||
const promises_1 = __importDefault(require("node:dns/promises")); | ||
const Utils_1 = require("./Utils"); | ||
const wss = new ws_1.default.Server({ noServer: true }); | ||
@@ -89,3 +90,3 @@ const defaultOptions = { logLevel: Types_1.LOG_LEVEL.INFO }; | ||
logger.error(`An error occured in the connection to ${connectFrame.hostname} (${wispFrame.streamID}) with the message ${err.message}`); | ||
ws.send(Packets_1.default.closePacketMaker(wispFrame, 0x03)); // 0x03 in the WISP protocol is defined as network error | ||
ws.send(Packets_1.default.closePacketMaker(wispFrame, (0, Utils_1.checkErrorCode)(err))); | ||
connections.delete(wispFrame.streamID); | ||
@@ -136,3 +137,3 @@ }); | ||
logger.error(`An error occured in the connection to ${connectFrame.hostname} (${wispFrame.streamID}) with the message ${err.message}`); | ||
ws.send(Packets_1.default.closePacketMaker(wispFrame, 0x03)); | ||
ws.send(Packets_1.default.closePacketMaker(wispFrame, (0, Utils_1.checkErrorCode)(err))); | ||
connections.delete(wispFrame.streamID); | ||
@@ -139,0 +140,0 @@ client.close(); |
@@ -8,6 +8,9 @@ "use strict"; | ||
const node_http_1 = __importDefault(require("node:http")); | ||
const Types_1 = require("./Types"); | ||
const httpServer = node_http_1.default.createServer().listen(process.env.PORT || 3000); | ||
httpServer.on("upgrade", (req, socket, head) => { | ||
ConnectionHandler_1.default.routeRequest(req, socket, head); | ||
ConnectionHandler_1.default.routeRequest(req, socket, head, { | ||
logLevel: Types_1.LOG_LEVEL.DEBUG | ||
}); | ||
}); | ||
//# sourceMappingURL=createServer.js.map |
{ | ||
"name": "wisp-server-node", | ||
"version": "1.1.3", | ||
"version": "1.1.4", | ||
"type": "commonjs", | ||
@@ -5,0 +5,0 @@ "description": "", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
70466
24
473