Get japanese carrier from ip (Based on jpmobile-ipaddresses rails plugin by jpmobile)
JavaScript
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
README.md
package.json

README.md

jpmobile-ip

Get japanese carrier from ip (Based on jpmobile-ipaddresses rails plugin by jpmobile).

Created for cubie-talk.com, to deal with the situation that Softbank does not allow collections to ports other than 80 from the default Android browser.

Currently supported carriers

Softbank

Installation

npm install jpmobile-ip

Usage

var jpmobile = require('jpmobile-ip');

if (jpmobile.isIpFromCarrier(req.connection.remoteAddress, "softbank")) {
  // Do something..
}

or as Express middleware

app.configure(function() {
  app.use(jpmobile.middleware());
});

app.get("/", function (req, res) {
    console.log(req.carrier);
});