switch to @gridspace/basic-ftp for PASV NAT fix
This commit is contained in:
parent
0a9330d41d
commit
73b2a0f296
2 changed files with 5 additions and 5 deletions
|
|
@ -36,7 +36,7 @@ module.exports = async (server) => {
|
||||||
let request = this.#topic_request = `device/${serial}/request`;
|
let request = this.#topic_request = `device/${serial}/request`;
|
||||||
// util.log({ report, request });
|
// util.log({ report, request });
|
||||||
client.subscribe(report, (err) => {
|
client.subscribe(report, (err) => {
|
||||||
util.log('mqtt_subd', this.#serial, err);
|
util.log('mqtt sub', this.#serial, err || "ok");
|
||||||
onready(this);
|
onready(this);
|
||||||
this.keepalive();
|
this.keepalive();
|
||||||
});
|
});
|
||||||
|
|
@ -61,7 +61,7 @@ module.exports = async (server) => {
|
||||||
|
|
||||||
async send(msg) {
|
async send(msg) {
|
||||||
if (this.#client) {
|
if (this.#client) {
|
||||||
util.log('mqtt_send', this.#serial, msg);
|
util.log('mqtt send', this.#serial, msg);
|
||||||
this.#client.publish(this.#topic_request, JSON.stringify(msg));
|
this.#client.publish(this.#topic_request, JSON.stringify(msg));
|
||||||
this.keepalive();
|
this.keepalive();
|
||||||
return true;
|
return true;
|
||||||
|
|
@ -146,7 +146,7 @@ module.exports = async (server) => {
|
||||||
const list = [];
|
const list = [];
|
||||||
try {
|
try {
|
||||||
list.push(...(await client.list()));
|
list.push(...(await client.list()));
|
||||||
// list.push(...(await client.list("/cache")));
|
list.push(...(await client.list("/cache")));
|
||||||
} finally {
|
} finally {
|
||||||
client.close();
|
client.close();
|
||||||
}
|
}
|
||||||
|
|
@ -230,7 +230,7 @@ module.exports = async (server) => {
|
||||||
|
|
||||||
server.ws.register("/bambu", function(ws, req) {
|
server.ws.register("/bambu", function(ws, req) {
|
||||||
wsopen.push(ws);
|
wsopen.push(ws);
|
||||||
util.log('ws open', wsopen.length, req.url);
|
util.log('ws open', req.url, wsopen.length);
|
||||||
ws.on('message', msg => {
|
ws.on('message', msg => {
|
||||||
msg = JSON.parse(msg);
|
msg = JSON.parse(msg);
|
||||||
let { cmd, host, code, serial } = msg;
|
let { cmd, host, code, serial } = msg;
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@
|
||||||
"url": "https://github.com/gridspace/apps.git"
|
"url": "https://github.com/gridspace/apps.git"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"basic-ftp": "^5.0.5",
|
"@gridspace/basic-ftp": "^5.0.5",
|
||||||
"mqtt": "^5.10.3"
|
"mqtt": "^5.10.3"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue