joakimunge / deno-local-ip Goto Github PK
View Code? Open in Web Editor NEWTiny module for Deno to get local network interface address.
License: MIT License
Tiny module for Deno to get local network interface address.
License: MIT License
I have the following setup in my local machine:
docker0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
inet 172.17.0.1 netmask 255.255.0.0 broadcast 172.17.255.255
inet6 fe80::42:d3ff:fef3:bb65 prefixlen 64 scopeid 0x20<link>
ether 02:42:d3:f3:bb:65 txqueuelen 0 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 3 bytes 306 (306.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
ens4: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1460
inet 10.148.0.5 netmask 255.255.255.255 broadcast 0.0.0.0
inet6 fe80::4001:aff:fe94:5 prefixlen 64 scopeid 0x20<link>
ether 42:01:0a:94:00:05 txqueuelen 1000 (Ethernet)
RX packets 2897452 bytes 1906694558 (1.9 GB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 2811602 bytes 983938685 (983.9 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 129025 bytes 12076299 (12.0 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 129025 bytes 12076299 (12.0 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
Apparently, this library picked up docker0 as the IP and reported it to my remote system which resulted in it being unreachable.
This module uses the command ifconfig
to fetch the users ip.
Maybe support for windows could be implemented using the similar ipconfig
shell command?
i got undefined using the latest version
import { getNetworkAddr } from 'https://deno.land/x/local_ip/mod.ts';
const netAddr = await getNetworkAddr(); // undefined
I think, for use as a module it should throw the errrors, rather than logging them.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.