Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ip2region_ext

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ip2region_ext

  • 0.1.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Ip2regionExt

介绍

这是一个ip2region库c客户端的ruby ffi扩展, 基于 lionsoul2014/ip2region 最新版本开发

直接调用c原生api,充分发挥IO操作的性能优势

安装

gem install ip2region_ext

使用

require 'ip2region_ext'

# 查询
#db_type = :file|:index|:cache
#Ip2regionExt.connect({db_type: :index, db_path: "/var/ip2region.xdb"})
Ip2regionExt.connect({db_type: :index})
p Ip2regionExt.search('114.114.114.114')
Ip2regionExt.close
# => "中国|0|辽宁省|丹东市|联通"

如何下载外挂 xdb 文件

下载这个文件 https://github.com/lionsoul2014/ip2region/blob/master/data/ip2region.xdb

协议

MIT 协议

FAQs

Package last updated on 10 Jun 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc