I attempt to use express to obtain visitor ip address using: console.log(req.ip); I connected to ngrok tunnel on a different device and ISP to test load the page. But I am getting the result as ::1 instead of an IP address. Anyone can advise what should I do?
            Asked
            
        
        
            Active
            
        
            Viewed 405 times
        
    1 Answers
0
            
            
        const clientIpAddress = String(req.headers["x-forwarded-for"] || req.connection.remoteAddress);
 
    
    
        geekanant
        
- 41
- 3
- 
                    1I would recommend against posting on clearly duplicate question as it only promotes people to post duplicates without any research effort.. – Anunay Sep 18 '20 at 11:33
