New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

service-geoip

Package Overview
Dependencies
Maintainers
2
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

service-geoip

A RabbitMQ microservice wrapping the node-geoip package (geoip-lite on npm).

  • 1.3.6
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
15
increased by1400%
Maintainers
2
Weekly downloads
 
Created
Source

node-service-geoip

a RabbitMQ microservice wrapping the node-geoip package (geoip-lite on npm).

project status

Done
  • Used in production
  • Spawning one process / CPU core
  • Dockerized
  • Deployable via Tutum
Todo
  • 100% coverage
  • Documentation

service install

npm install service-geoip
npm updatedb used to build the geo DB. This is not needed when module is used as a client.

docker build

docker build .

configuration

configuration can be done using the config.json file and env vars

config.json
{
  "amqp": "amqp://localhost",
  "queue": "geo:ip", 
  "port": 8080
}

amqp: amqp broker connexion string
queue: queue used to send and receive messages
port: status port checking the service health

env vars
AMQP_SRV=amqp://localhost
AMQP_QUEUE=geo:ip

usage

as a microservice

configure the module (see #configuration section) and then

npm start

if you are using it via Docker, this is done automatically.

as a client

var lib = require('service-geoip')({ amqp: 'amqp://localhost', queue: 'geo:ip' });
lib.connect().then(function(){
  //connexion logic here
});

lib.send('95.130.11.91').then(function(loc){
  //use loc object here
});

from a compatible amqp broker

just send the IP as the message content on the queue you have defined (see #configuration)

Tutum

Here is a sample stackfile to deploy your microservice (create your tutum repository from the github repo first)

rabbitmq-master:
  image: 'tutum/rabbitmq:latest'
  environment:
    - RABBITMQ_PASS=PASSWORD
service-geoip:
  image: 'tutum.co/TUTUM_USER/service-geoip:latest'
  environment:
    - 'AMQP_SRV=amqp://admin:PASSWORD@rabbitmq-master'
  links:
    - rabbitmq-master
  ports:
    - '9001:8080'

Keywords

FAQs

Package last updated on 21 Oct 2015

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