Skip to content

Instantly share code, notes, and snippets.

@jackmaney
Created April 2, 2014 18:16
Show Gist options
  • Save jackmaney/9939896 to your computer and use it in GitHub Desktop.
Save jackmaney/9939896 to your computer and use it in GitHub Desktop.
Server-side UA Sniffing to Detect Browser
var express = require('express');
var uaParser = require('ua-parser')
var app = express();
app.get('/', function(req,res){
var r = uaParser.parse(req.headers['user-agent']);
res.status(200).send(r.ua.family);
})
app.listen(3000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment