Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

620
Visualizações
How to get My PUBLIC IP address Using Node js

I want to get my Public IP address using Node js only

For example when i search on Google "What is my Ip address "

Gives me output like 10X.XX.XX.XXX

How to get this Ip address Using node js without importing any Libraries like ip , Public-ip etc ...

I want to write my Custom Code to get public ip Without sending requests to other websites like whatismyipaddress.com , ipconfig.com etc ...

about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

const { exec } = require('child_process')

exec('curl ip-adresim.app', function(error, stdout, stderr){
    if(error)
        return;
    console.log('your ip is :'+ stdout);
})

you could run a command and get the output like curl or ping

enter image description here

about 4 years ago · Juan Pablo Isaza Relatório

0

There is no native way to get the public IP, in fact, there is no way to get it from your server, not even from the Linux command, you have to ask an external server, and this package does exactly so with different servers.

I understand you don't want to ask an external library or an external server, but you have no choice.

Im suggesting using an external library, because it takes care of asking multiple servers instead of just one in the case that one goes offline

You can try this package it works perfectly

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda