Add force server url override
This commit is contained in:
parent
d54b69ce80
commit
65e3cb9797
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@cubetiq/hlt",
|
"name": "@cubetiq/hlt",
|
||||||
"version": "0.1.3",
|
"version": "0.1.4",
|
||||||
"description": "A lightweight http tunnel client using nodejs and socket.io client",
|
"description": "A lightweight http tunnel client using nodejs and socket.io client",
|
||||||
"main": "dist/client.js",
|
"main": "dist/client.js",
|
||||||
"bin": {
|
"bin": {
|
||||||
|
@ -245,8 +245,9 @@ program
|
|||||||
config = JSON.parse(fs.readFileSync(configFilePath, "utf8"));
|
config = JSON.parse(fs.readFileSync(configFilePath, "utf8"));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!config.server) {
|
// Force reset config server from client init
|
||||||
config.server = options.server || SERVER_DEFAULT_URL;
|
if (!config.server || options.force) {
|
||||||
|
config.server = options.server || config.server || SERVER_DEFAULT_URL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!config.token && options.token) {
|
if (!config.token && options.token) {
|
||||||
@ -267,7 +268,7 @@ program
|
|||||||
|
|
||||||
let errorCode = 0;
|
let errorCode = 0;
|
||||||
if (!config.token || options.force) {
|
if (!config.token || options.force) {
|
||||||
console.log("Generating token...");
|
console.log(`Generating token from server: ${config.server}`);
|
||||||
await getTokenFree(config.server, {
|
await getTokenFree(config.server, {
|
||||||
timestamp: (new Date().getTime()),
|
timestamp: (new Date().getTime()),
|
||||||
clientId: config.clientId,
|
clientId: config.clientId,
|
||||||
|
Loading…
Reference in New Issue
Block a user