req.ips
如果啟用 sails.config.http.trustProxy,此變數會包含此請求的 "X-Forwarded-For" 標頭中的 IP 位址,以 IP 位址字串陣列的形式呈現。否則會回傳一個空陣列。
req.ips;
如果請求包含標頭 "X-Forwarded-For: client, proxy1, proxy2"
req.ips;
// -> ["client", "proxy1", "proxy2"]`
// ("proxy2" is the furthest "down-stream" IP address)