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");
|
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 = "";
|
||||||
|
|
Reference in a new issue