generated from Dicken/dickendock
round25: Scanner-Haenger behoben (Portpruefung parallelisiert statt sequentiell), Abbrechen-Button fuer beide Scanner
This commit is contained in:
@@ -91,12 +91,22 @@ export async function scanDeviceServices(
|
||||
const suggestedHostname = dnsResult ? null : await reverseLookup(device.ip);
|
||||
|
||||
const candidatePorts = Array.from(new Set([80, 443, ...extraPorts]));
|
||||
|
||||
// Die offenen Ports werden PARALLEL geprüft, nicht nacheinander - bei
|
||||
// einem nicht erreichbaren/gefilterten Gerät (z. B. ein schlafender
|
||||
// Laptop) würde ein sequenzieller Durchlauf sonst bis zu
|
||||
// Portanzahl × Timeout dauern (bei 20 Ports und 800ms Timeout: 16+
|
||||
// Sekunden PRO GERÄT) und den Scan wie hängengeblieben wirken lassen.
|
||||
// Danach wird nur noch für die tatsächlich offenen Ports (meist wenige)
|
||||
// die eigentliche HTTP-Abfrage gemacht.
|
||||
const openChecks = await Promise.all(
|
||||
candidatePorts.map(async (port) => ({ port, open: await isPortOpen(device.ip, port) }))
|
||||
);
|
||||
const openPorts = openChecks.filter((c) => c.open).map((c) => c.port);
|
||||
|
||||
const found: DiscoveredService[] = [];
|
||||
|
||||
for (const port of candidatePorts) {
|
||||
const open = await isPortOpen(device.ip, port);
|
||||
if (!open) continue;
|
||||
|
||||
for (const port of openPorts) {
|
||||
let isHttps = port === 443 || port === 9443 || port === 8006 || port === 8443;
|
||||
let baseUrl = `${isHttps ? "https" : "http"}://${address}:${port}`;
|
||||
let probe = await probeHttp(baseUrl);
|
||||
|
||||
Reference in New Issue
Block a user