标签:
/** * Created by chaozhou on 2015/11/24. */ var getIp = function(req){ var ipStr = req.headers[‘x-forwarded-for‘]; //F5 if(ipStr){ return ipStr; }else{ return req.ip.substring(req.ip.lastIndexOf(":") + 1); //F5获取不到时 } }; exports.getIp = getIp;
标签:
原文地址:http://www.cnblogs.com/caiya928/p/5025205.html