How to get the real client ip for a request when tunneling with ngrok

前端 未结 1 1974
情话喂你
情话喂你 2021-01-17 22:23

How can I make sure that the client IP address is forwarded by ngrok?

My test code keeps insisting that all the requests are coming from 127.0.0.1 because of ngrok b

相关标签:
1条回答
  • 2021-01-17 22:46

    Unfortunately, all header names in Node.JS are lowercase. Use

    req.headers['x-forwarded-for']
    

    instead of

    req.headers['X-Forwarded-For']
    
    0 讨论(0)
提交回复
热议问题