How to Get Client IP Address in Node JS Application

How to Get Client IP Address in Node JS Application

In this article, we will explain to you how to get client IP address in node js application. sometimes we need to client ip address in node js, We will use get the real IP address in node js app. Let’s start with how to find out the IP address of the client in the node js.

We can easily get client ip address using the request-ip NPM package in node js application. This npm package retrieves a request’s IP address in node js.

Node Js Application Setup

First, we will open the command prompt and create the application in our directory. for this, you can follow the below command.

Install NPM Package

After the done setup node js application, we will install the express and request-ip npm package. so you can see the following npm command.

Set up Node js Application

In this step, We will create a server.js file and set up the node js application using express.
server.js

server.js

Run Node js Application

we will run the node js application using the below command. so you can follow the below command.

Now you can run the example using the below Url in the browser.

Please follow and like us: