Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

174
Views
Get IP of express/socket.io server

i'm using express for the server of my node.js app, the server is set up like this:

const app = express();
const server = app.listen(port);

i'm also using the server for a socket.io server if that makes a difference:

const server = io(server, { pingTimeout: 60000, pingInterval: 500 });

is there a way to get the ip/url of the server? something like:

console.log(server.ip); //returns something like 42.32.208.189 or 192.168.1.190

EDIT: alright figured it out, there's useful package (https://github.com/indutny/node-ip) that allows you to just do

const ip = require("ip");
console.log(ip.address()); //returns something like 42.32.208.189 or 192.168.1.190
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!