NGINX Unit - universal web app server - a lightweight and versatile open source server that simplifies the application stack by natively executing application code across eight different programming language runtimes.
It seems like only the "websocket" module is support and not also "ws" as npm package/overriding:
// can only be ran as part of a --require param on the node process
if (module.parent && module.parent.id === "internal/preload") {
const { Module } = require("module")
if (!Module.prototype.require.__unit_loader) {
const http = require("./http")
const websocket = require("./websocket")
const original = Module.prototype.require;
Module.prototype.require = function (id) {
switch(id) {
case "http":
case "node:http":
case "unit-http":
return http
case "websocket":
case "node:websocket":
case "unit-http/websocket":
return websocket
}
return original.apply(this, arguments);
}
Module.prototype.require.__unit_loader = true;
}
}
Would it be possible to ad a "ws" case for WebSockets? (Which is the far popular used WebSocket module)
|
Where can i find the source code/repo of the unit-http module?
While trying to fix the error #1219 & browsing the source code of the
unit-http
module on https://www.npmjs.com/package/unit-http?activeTab=code i stumbled across the file "loader.js".It seems like only the "websocket" module is support and not also "ws" as npm package/overriding:
Would it be possible to ad a "ws" case for WebSockets? (Which is the far popular used WebSocket module)
|
Where can i find the source code/repo of the unit-http module?
Side note: there is no "node:websocket" module.