簡體   English   中英

獲取在expressjs中發出請求的客戶端的IP地址

[英]Get the ip address of the client making the request in expressjs

我在Azure上部署了一個應用程序,我試圖獲取遠程客戶端的IP地址。 不幸的是,當我嘗試調用時,我總是得到一個不確定的值

req.ip

您有獲取IP地址的想法嗎?

const remoteAddress = req.headers['x-forwarded-for'] || req.connection.remoteAddress;

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM