Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
36 lines (23 sloc) 671 Bytes

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);
});
Something went wrong with that request. Please try again.