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.
Softbank
npm install jpmobile-ip
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);
});