“escaneo de red local” Código de respuesta

escaneo de red local

import { scanLocalNetwork } from 'local-network-scan';

(async () => {

	// Scan default network, with default option
	const res1 = await scanLocalNetwork();
	console.log(res1); // [{ ip: '192.168.1.1', mac: '11aa22bb33cc' }, { ip: '192.168.1.2', mac: '12ab23bc34cd' }]

	// Scan specific network
	const res2 = await scanLocalNetwork({ localNetwork: '192.168.2' });
	console.log(res2); // [{ ip: '192.168.2.1', mac: '11aa22bb33cc' }, { ip: '192.168.2.2', mac: '12ab23bc34cd' }]

	// Query device vendor (using https://macvendors.com/ API) - OFF by default
	const res3 = await scanLocalNetwork({ queryVendor: true });
	console.log(res3); // [{ ip: '192.168.2.1', mac: '11aa22bb33cc', vendor: 'some vendor' }, { ip: '192.168.2.2', mac: '12ab23bc34cd', vendor: ''  }]
})()

escaneo de red local

import { scanLocalNetwork } from 'local-network-scan';

(async () => {

	// Scan default network, with default option
	const res1 = await scanLocalNetwork();
	console.log(res1); // [{ ip: '192.168.1.1', mac: '11aa22bb33cc' }, { ip: '192.168.1.2', mac: '12ab23bc34cd' }]

	// Scan specific network
	const res2 = await scanLocalNetwork({ localNetwork: '192.168.2' });
	console.log(res2); // [{ ip: '192.168.2.1', mac: '11aa22bb33cc' }, { ip: '192.168.2.2', mac: '12ab23bc34cd' }]

	// Query device vendor (using https://macvendors.com/ API) - OFF by default
	const res3 = await scanLocalNetwork({ queryVendor: true });
	console.log(res3); // [{ ip: '192.168.2.1', mac: '11aa22bb33cc', vendor: 'some vendor' }, { ip: '192.168.2.2', mac: '12ab23bc34cd', vendor: ''  }]
})()

Respuestas similares a “escaneo de red local”

Preguntas similares a “escaneo de red local”

Más respuestas relacionadas con “escaneo de red local” en JavaScript

Explore las respuestas de código populares por idioma

Explorar otros lenguajes de código