UNPKG
discover-my-ip
Version:
latest (1.3.1)
1.3.1
1.2.1
1.0.1
Discovery your ip in a simple way
github.com/vsoaresbruno/my-ip
vsoaresbruno/my-ip
discover-my-ip
/
lib
/
index.js
12 lines
(9 loc)
•
269 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
var
http =
require
(
"http"
);
var
req = http.
get
(
'http://www.meuip.com/api/meuip.php'
,
(
res
) =>
{ res.
on
(
'data'
,
function
(
chunk
) {
console
.
log
(
'Your IP: '
+ chunk); }); }); req.
on
(
'error'
,
function
(
e
) {
console
.
log
(
'problem with request: '
+ e.
message
); });