0.0.5 • Published 6 years ago

ipbase v0.0.5

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

ipbase

NPM version Build Status Coverage Status

IP common function

使用方法

白名单判断

console.log(ipbase.ipInList('127.0.0.1', '127.0.0.1'));
// > true

console.log(ipbase.ipInList('127.0.0.1', ['127.0.0.1', '10.10.110.10']));
// > true

获取客户端地址

var req = {
  headers: {
    'x-real-ip': '198.168.100.54'
  }
}
console.log(ipbase.getClientAddress(req));
// > 198.168.100.54

License

MIT © zswang

0.0.5

6 years ago

0.0.2

7 years ago

0.0.1

7 years ago