1
0
Fork 0
forked from svrjs/svrjs

Change code for Node.JS builds without crypto library

This commit is contained in:
Dorian Niemiec 2024-03-31 18:55:27 +02:00
parent 3b7271386c
commit 5638a45e6e

24
svr.js
View file

@ -448,21 +448,23 @@ try {
crypto = require("crypto"); crypto = require("crypto");
https = require("https"); https = require("https");
} catch (err) { } catch (err) {
crypto = {}; crypto = {
https = {}; __disabled__: null
crypto.__disabled__ = null; };
https.createServer = function () { https = {
throw new Error("Crypto support is not present"); createServer: function () {
throw new Error("Crypto support is not present");
},
connect: function () {
throw new Error("Crypto support is not present");
},
get: function () {
throw new Error("Crypto support is not present");
}
}; };
http2.createSecureServer = function () { http2.createSecureServer = function () {
throw new Error("Crypto support is not present"); throw new Error("Crypto support is not present");
}; };
https.connect = function () {
throw new Error("Crypto support is not present");
};
https.get = function () {
throw new Error("Crypto support is not present");
};
} }
var mime = require("mime-types"); var mime = require("mime-types");
var pubip = ""; var pubip = "";