forked from svrjs/svrjs
Implement sending data to the statistics server
This commit is contained in:
parent
ef78a88a39
commit
233af94d28
1 changed files with 3 additions and 4 deletions
|
@ -889,8 +889,7 @@ function listeningMessage() {
|
||||||
serverconsole.locmessage("For CLI help, you can type \"help\"");
|
serverconsole.locmessage("For CLI help, you can type \"help\"");
|
||||||
|
|
||||||
// Code for sending data to a statistics server
|
// Code for sending data to a statistics server
|
||||||
// TODO: uncomment this
|
if (!process.serverConfig.optOutOfStatisticsServer) {
|
||||||
/*if (!optOutOfStatisticsServer) {
|
|
||||||
if (crypto.__disabled__ !== undefined) {
|
if (crypto.__disabled__ !== undefined) {
|
||||||
serverconsole.locwarnmessage("Sending data to statistics server is disabled, because the server only supports HTTPS, and your Node.JS version doesn't have crypto support.");
|
serverconsole.locwarnmessage("Sending data to statistics server is disabled, because the server only supports HTTPS, and your Node.JS version doesn't have crypto support.");
|
||||||
} else {
|
} else {
|
||||||
|
@ -903,7 +902,7 @@ function listeningMessage() {
|
||||||
const statisticsRequest = https.request(statisticsServerCollectEndpoint, {
|
const statisticsRequest = https.request(statisticsServerCollectEndpoint, {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
headers: {
|
headers: {
|
||||||
"User-Agent": (exposeServerVersion ? "SVR.JS/" + version + " (" + getOS() + "; " + (process.isBun ? ("Bun/v" + process.versions.bun + "; like Node.JS/" + process.version) : ("Node.JS/" + process.version)) + ")" : "SVR.JS"),
|
"User-Agent": generateServerString(true),
|
||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
"Content-Length": Buffer.byteLength(statisticsToSend)
|
"Content-Length": Buffer.byteLength(statisticsToSend)
|
||||||
}
|
}
|
||||||
|
@ -933,7 +932,7 @@ function listeningMessage() {
|
||||||
});
|
});
|
||||||
statisticsRequest.end(statisticsToSend);
|
statisticsRequest.end(statisticsToSend);
|
||||||
}
|
}
|
||||||
}*/
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Reference in a new issue