forked from svrjs/svrjs
Change code for Node.JS builds without crypto library
This commit is contained in:
parent
3b7271386c
commit
5638a45e6e
1 changed files with 13 additions and 11 deletions
24
svr.js
24
svr.js
|
@ -448,21 +448,23 @@ try {
|
|||
crypto = require("crypto");
|
||||
https = require("https");
|
||||
} catch (err) {
|
||||
crypto = {};
|
||||
https = {};
|
||||
crypto.__disabled__ = null;
|
||||
https.createServer = function () {
|
||||
throw new Error("Crypto support is not present");
|
||||
crypto = {
|
||||
__disabled__: null
|
||||
};
|
||||
https = {
|
||||
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 () {
|
||||
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 pubip = "";
|
||||
|
|
Reference in a new issue