diff --git a/test/test.ts b/test/test.ts index a366cf9..03a1c97 100644 --- a/test/test.ts +++ b/test/test.ts @@ -25,7 +25,7 @@ tap.test('should scan a port', async () => { }); tap.test('should get the default gateways', async () => { - const gatewayResult = await testSmartNetwork.getDefaultGateway(); + const gatewayResult = await testSmartNetwork.getGateways(); console.log(gatewayResult); }); diff --git a/ts/smartnetwork.classes.smartnetwork.ts b/ts/smartnetwork.classes.smartnetwork.ts index 03d18b5..2af37b2 100644 --- a/ts/smartnetwork.classes.smartnetwork.ts +++ b/ts/smartnetwork.classes.smartnetwork.ts @@ -129,11 +129,8 @@ export class SmartNetwork { return result; } - public async getDefaultGateway() { - const result = { - v4: await plugins.defaultGateway.v4(), - v6: await plugins.defaultGateway.v6() - }; + public async getGateways() { + const result = plugins.os.networkInterfaces(); return result; } } diff --git a/ts/smartnetwork.plugins.ts b/ts/smartnetwork.plugins.ts index 69a7d3d..e95a91b 100644 --- a/ts/smartnetwork.plugins.ts +++ b/ts/smartnetwork.plugins.ts @@ -1,4 +1,9 @@ // native scope +import * as os from 'os'; + +export { + os +}; // @pushrocks scope import * as smartpromise from '@pushrocks/smartpromise'; @@ -6,9 +11,8 @@ import * as smartstring from '@pushrocks/smartstring'; export { smartpromise, smartstring }; -// @third party scope -import defaultGateway from 'default-gateway'; +// @third party scope const speedtestNet = require('speedtest-net'); import * as portscanner from 'portscanner'; -export { defaultGateway, speedtestNet, portscanner }; +export { speedtestNet, portscanner };