mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-02-12 11:01:52 +00:00
Added --bindany option to MeshCMD MicroLMS.
This commit is contained in:
parent
3d549dc187
commit
1240733d6c
3 changed files with 21 additions and 4 deletions
|
@ -157,6 +157,7 @@ function run(argv) {
|
||||||
if ((typeof args.uuidoutput) == 'string' || args.uuidoutput) { settings.uuidoutput = args.uuidoutput; }
|
if ((typeof args.uuidoutput) == 'string' || args.uuidoutput) { settings.uuidoutput = args.uuidoutput; }
|
||||||
if ((typeof args.desc) == 'string') { settings.desc = args.desc; }
|
if ((typeof args.desc) == 'string') { settings.desc = args.desc; }
|
||||||
if ((typeof args.dnssuffix) == 'string') { settings.dnssuffix = args.dnssuffix; }
|
if ((typeof args.dnssuffix) == 'string') { settings.dnssuffix = args.dnssuffix; }
|
||||||
|
if (args.bindany) { settings.bindany = true; }
|
||||||
if (args.emailtoken) { settings.emailtoken = true; }
|
if (args.emailtoken) { settings.emailtoken = true; }
|
||||||
if (args.smstoken) { settings.smstoken = true; }
|
if (args.smstoken) { settings.smstoken = true; }
|
||||||
if (args.debug === true) { settings.debuglevel = 1; }
|
if (args.debug === true) { settings.debuglevel = 1; }
|
||||||
|
|
|
@ -17,6 +17,7 @@ limitations under the License.
|
||||||
var MemoryStream = require('MemoryStream');
|
var MemoryStream = require('MemoryStream');
|
||||||
var lme_id = 0; // Our next channel identifier
|
var lme_id = 0; // Our next channel identifier
|
||||||
var lme_port_offset = 0; // Debug: Set this to "-100" to bind to 16892 & 16893 and IN_ADDRANY. This is for LMS debugging.
|
var lme_port_offset = 0; // Debug: Set this to "-100" to bind to 16892 & 16893 and IN_ADDRANY. This is for LMS debugging.
|
||||||
|
var lme_bindany = false; // If true, bind to all network interfaces, not just loopback.
|
||||||
var xmlParser = null;
|
var xmlParser = null;
|
||||||
try { xmlParser = require('amt-xml'); } catch (ex) { }
|
try { xmlParser = require('amt-xml'); } catch (ex) { }
|
||||||
|
|
||||||
|
@ -123,7 +124,10 @@ function lme_heci(options) {
|
||||||
if (name == 'connect' && this._LME._connected == true) { func.call(this); }
|
if (name == 'connect' && this._LME._connected == true) { func.call(this); }
|
||||||
if (name == 'error' && this._LME._error !=null) { func.call(this, this._LME._error); }
|
if (name == 'error' && this._LME._error !=null) { func.call(this, this._LME._error); }
|
||||||
});
|
});
|
||||||
if ((options != null) && (options.debug == true)) { lme_port_offset = -100; } // LMS debug mode
|
if (options != null) {
|
||||||
|
if (options.debug == true) { lme_port_offset = -100; } // LMS debug mode
|
||||||
|
if (options.bindany == true) { lme_bindany = true; } // Bind to all ports
|
||||||
|
}
|
||||||
|
|
||||||
var heci = require('heci');
|
var heci = require('heci');
|
||||||
this.INITIAL_RXWINDOW_SIZE = 4096;
|
this.INITIAL_RXWINDOW_SIZE = 4096;
|
||||||
|
@ -189,7 +193,11 @@ function lme_heci(options) {
|
||||||
this[name][port].descriptorMetadata = 'amt-lme (port: ' + port + ')';
|
this[name][port].descriptorMetadata = 'amt-lme (port: ' + port + ')';
|
||||||
this[name][port].HECI = this;
|
this[name][port].HECI = this;
|
||||||
if (lme_port_offset == 0) {
|
if (lme_port_offset == 0) {
|
||||||
this[name][port].listen({ port: port, host: '127.0.0.1' }); // Normal mode
|
if (lme_bindany) {
|
||||||
|
this[name][port].listen({ port: port }); // Bind all mode
|
||||||
|
} else {
|
||||||
|
this[name][port].listen({ port: port, host: '127.0.0.1' }); // Normal mode
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
this[name][port].listen({ port: (port + lme_port_offset) }); // Debug mode
|
this[name][port].listen({ port: (port + lme_port_offset) }); // Debug mode
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,6 +17,7 @@ limitations under the License.
|
||||||
var MemoryStream = require('MemoryStream');
|
var MemoryStream = require('MemoryStream');
|
||||||
var lme_id = 0; // Our next channel identifier
|
var lme_id = 0; // Our next channel identifier
|
||||||
var lme_port_offset = 0; // Debug: Set this to "-100" to bind to 16892 & 16893 and IN_ADDRANY. This is for LMS debugging.
|
var lme_port_offset = 0; // Debug: Set this to "-100" to bind to 16892 & 16893 and IN_ADDRANY. This is for LMS debugging.
|
||||||
|
var lme_bindany = false; // If true, bind to all network interfaces, not just loopback.
|
||||||
var xmlParser = null;
|
var xmlParser = null;
|
||||||
try { xmlParser = require('amt-xml'); } catch (ex) { }
|
try { xmlParser = require('amt-xml'); } catch (ex) { }
|
||||||
|
|
||||||
|
@ -123,7 +124,10 @@ function lme_heci(options) {
|
||||||
if (name == 'connect' && this._LME._connected == true) { func.call(this); }
|
if (name == 'connect' && this._LME._connected == true) { func.call(this); }
|
||||||
if (name == 'error' && this._LME._error !=null) { func.call(this, this._LME._error); }
|
if (name == 'error' && this._LME._error !=null) { func.call(this, this._LME._error); }
|
||||||
});
|
});
|
||||||
if ((options != null) && (options.debug == true)) { lme_port_offset = -100; } // LMS debug mode
|
if (options != null) {
|
||||||
|
if (options.debug == true) { lme_port_offset = -100; } // LMS debug mode
|
||||||
|
if (options.bindany == true) { lme_bindany = true; } // Bind to all ports
|
||||||
|
}
|
||||||
|
|
||||||
var heci = require('heci');
|
var heci = require('heci');
|
||||||
this.INITIAL_RXWINDOW_SIZE = 4096;
|
this.INITIAL_RXWINDOW_SIZE = 4096;
|
||||||
|
@ -189,7 +193,11 @@ function lme_heci(options) {
|
||||||
this[name][port].descriptorMetadata = 'amt-lme (port: ' + port + ')';
|
this[name][port].descriptorMetadata = 'amt-lme (port: ' + port + ')';
|
||||||
this[name][port].HECI = this;
|
this[name][port].HECI = this;
|
||||||
if (lme_port_offset == 0) {
|
if (lme_port_offset == 0) {
|
||||||
this[name][port].listen({ port: port, host: '127.0.0.1' }); // Normal mode
|
if (lme_bindany) {
|
||||||
|
this[name][port].listen({ port: port }); // Bind all mode
|
||||||
|
} else {
|
||||||
|
this[name][port].listen({ port: port, host: '127.0.0.1' }); // Normal mode
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
this[name][port].listen({ port: (port + lme_port_offset) }); // Debug mode
|
this[name][port].listen({ port: (port + lme_port_offset) }); // Debug mode
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue