update WTVFTP to new module system
This commit is contained in:
@@ -26,8 +26,6 @@ const WTVClientCapabilities = require(classPath + "/WTVClientCapabilities.js");
|
|||||||
const WTVClientSessionData = require(classPath + "/WTVClientSessionData.js");
|
const WTVClientSessionData = require(classPath + "/WTVClientSessionData.js");
|
||||||
const WTVMime = require(classPath + "/WTVMime.js");
|
const WTVMime = require(classPath + "/WTVMime.js");
|
||||||
const WTVFlashrom = require(classPath + "/WTVFlashrom.js");
|
const WTVFlashrom = require(classPath + "/WTVFlashrom.js");
|
||||||
const WTVFTP = require(classPath + "/WTVFTP.js");
|
|
||||||
const WTVPNM = require(classPath + "/WTVPNM.js");
|
|
||||||
const vm = require('vm');
|
const vm = require('vm');
|
||||||
const debug = require('debug')('app');
|
const debug = require('debug')('app');
|
||||||
const express = require('express');
|
const express = require('express');
|
||||||
@@ -1195,10 +1193,9 @@ minisrv-no-mail-count: true`;
|
|||||||
handlerModules["wtvhttp"].doHTTPProxy(socket, request_headers);
|
handlerModules["wtvhttp"].doHTTPProxy(socket, request_headers);
|
||||||
} else if (handlerModules["wtvgopher"] && shortURL.startsWith("gopher://")) {
|
} else if (handlerModules["wtvgopher"] && shortURL.startsWith("gopher://")) {
|
||||||
handlerModules["wtvgopher"].handleGopherRequest(socket, request_headers, wtvshared, sendToClient);
|
handlerModules["wtvgopher"].handleGopherRequest(socket, request_headers, wtvshared, sendToClient);
|
||||||
} else if (shortURL.startsWith('ftp://')) {
|
} else if (handlerModules["wtvftp"] &&shortURL.startsWith('ftp://')) {
|
||||||
if (minisrv_config.config.debug_flags.show_headers) console.debug(" * Incoming FTP request on WTVP socket ID", socket.id, await wtvshared.decodePostData(await wtvshared.filterRequestLog(await wtvshared.filterSSID(request_headers))));
|
if (minisrv_config.config.debug_flags.show_headers) console.debug(" * Incoming FTP request on WTVP socket ID", socket.id, await wtvshared.decodePostData(await wtvshared.filterRequestLog(await wtvshared.filterSSID(request_headers))));
|
||||||
const wtvftp = new WTVFTP(wtvshared, sendToClient);
|
handlerModules["wtvftp"].handleFTPRequest(socket, request_headers);
|
||||||
wtvftp.handleFTPRequest(socket, request_headers);
|
|
||||||
} else if (shortURL.indexOf('file://') >= 0) {
|
} else if (shortURL.indexOf('file://') >= 0) {
|
||||||
shortURL = shortURL.replace("file://",'').replace("romcache", "ROMCache");
|
shortURL = shortURL.replace("file://",'').replace("romcache", "ROMCache");
|
||||||
service_name = "wtv-star";
|
service_name = "wtv-star";
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ class WTVFTP {
|
|||||||
ftp = null;
|
ftp = null;
|
||||||
url = null;
|
url = null;
|
||||||
|
|
||||||
constructor(minisrv_config, sendToClient) {
|
constructor(minisrv_config, service_name, sendToClient) {
|
||||||
this.minisrv_config = minisrv_config;
|
this.minisrv_config = minisrv_config;
|
||||||
this.sendToClient = sendToClient;
|
this.sendToClient = sendToClient;
|
||||||
const WTVShared = require("./WTVShared.js")['WTVShared'];
|
const WTVShared = require("./WTVShared.js")['WTVShared'];
|
||||||
|
|||||||
@@ -301,7 +301,9 @@
|
|||||||
},
|
},
|
||||||
"ftp": {
|
"ftp": {
|
||||||
"port": 1650,
|
"port": 1650,
|
||||||
"connections": 3
|
"connections": 3,
|
||||||
|
"handler_module": "WTVFTP",
|
||||||
|
"handler_extra_vars": ["sendToClient"]
|
||||||
},
|
},
|
||||||
"http": {
|
"http": {
|
||||||
// http upstream
|
// http upstream
|
||||||
|
|||||||
Reference in New Issue
Block a user