mirror of
https://repository.entgra.net/community/device-mgt-core.git
synced 2025-10-06 02:01:45 +00:00
Deprecating serverAdress.js
This commit is contained in:
parent
5ed3174a28
commit
1172e759ca
@ -16,55 +16,59 @@
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
var serverAddress = function () {
|
||||
var log = new Log("serverAddress.js");
|
||||
var process = require("process"),
|
||||
host = process.getProperty('server.host'),
|
||||
ip = process.getProperty('carbon.local.ip');
|
||||
var publicMethods = {};
|
||||
publicMethods.getHTTPSAddress = function () {
|
||||
var port = process.getProperty('mgt.transport.https.proxyPort');
|
||||
if (!port) {
|
||||
port = process.getProperty('mgt.transport.https.port');
|
||||
}
|
||||
if (host === "localhost") {
|
||||
return "https://" + ip + ":" + port;
|
||||
} else {
|
||||
return "https://" + host + ":" + port;
|
||||
}
|
||||
};
|
||||
publicMethods.getHPPTAddress = function () {
|
||||
var port = process.getProperty('mgt.transport.http.proxyPort');
|
||||
if (!port) {
|
||||
port = process.getProperty('mgt.transport.http.port');
|
||||
}
|
||||
if (host === "localhost") {
|
||||
return "http://" + ip + ":" + port;
|
||||
} else {
|
||||
return "http://" + host + ":" + port;
|
||||
}
|
||||
};
|
||||
publicMethods.getWSSAddress = function () {
|
||||
var port = process.getProperty('mgt.transport.https.proxyPort');
|
||||
if (!port) {
|
||||
port = process.getProperty('mgt.transport.https.port');
|
||||
}
|
||||
if (host === "localhost") {
|
||||
return "wss://" + ip + ":" + port;
|
||||
} else {
|
||||
return "wss://" + host + ":" + port;
|
||||
}
|
||||
};
|
||||
publicMethods.getWSAddress = function () {
|
||||
var port = process.getProperty('mgt.transport.http.proxyPort');
|
||||
if (!port) {
|
||||
port = process.getProperty('mgt.transport.http.port');
|
||||
}
|
||||
if (host === "localhost") {
|
||||
return "ws://" + ip + ":" + port;
|
||||
} else {
|
||||
return "ws://" + host + ":" + port;
|
||||
}
|
||||
};
|
||||
return publicMethods;
|
||||
}();
|
||||
/*
|
||||
@Deprecated - new
|
||||
*/
|
||||
|
||||
//var serverAddress = function () {
|
||||
// var log = new Log("serverAddress.js");
|
||||
// var process = require("process"),
|
||||
// host = process.getProperty('server.host'),
|
||||
// ip = process.getProperty('carbon.local.ip');
|
||||
// var publicMethods = {};
|
||||
// publicMethods.getHTTPSAddress = function () {
|
||||
// var port = process.getProperty('mgt.transport.https.proxyPort');
|
||||
// if (!port) {
|
||||
// port = process.getProperty('mgt.transport.https.port');
|
||||
// }
|
||||
// if (host === "localhost") {
|
||||
// return "https://" + ip + ":" + port;
|
||||
// } else {
|
||||
// return "https://" + host + ":" + port;
|
||||
// }
|
||||
// };
|
||||
// publicMethods.getHPPTAddress = function () {
|
||||
// var port = process.getProperty('mgt.transport.http.proxyPort');
|
||||
// if (!port) {
|
||||
// port = process.getProperty('mgt.transport.http.port');
|
||||
// }
|
||||
// if (host === "localhost") {
|
||||
// return "http://" + ip + ":" + port;
|
||||
// } else {
|
||||
// return "http://" + host + ":" + port;
|
||||
// }
|
||||
// };
|
||||
// publicMethods.getWSSAddress = function () {
|
||||
// var port = process.getProperty('mgt.transport.https.proxyPort');
|
||||
// if (!port) {
|
||||
// port = process.getProperty('mgt.transport.https.port');
|
||||
// }
|
||||
// if (host === "localhost") {
|
||||
// return "wss://" + ip + ":" + port;
|
||||
// } else {
|
||||
// return "wss://" + host + ":" + port;
|
||||
// }
|
||||
// };
|
||||
// publicMethods.getWSAddress = function () {
|
||||
// var port = process.getProperty('mgt.transport.http.proxyPort');
|
||||
// if (!port) {
|
||||
// port = process.getProperty('mgt.transport.http.port');
|
||||
// }
|
||||
// if (host === "localhost") {
|
||||
// return "ws://" + ip + ":" + port;
|
||||
// } else {
|
||||
// return "ws://" + host + ":" + port;
|
||||
// }
|
||||
// };
|
||||
// return publicMethods;
|
||||
//}();
|
||||
Loading…
Reference in New Issue
Block a user