一、获取手机在微信内置浏览器的User-Agent var http = require('http'); http.createServer(function(req, res) { res.writeHead(200, {'Content-type' : 'text/html'}); res.write('user-agent='+req.headers["user-agent"]); console.log(req.headers["user-agent"]); res.end(); }).listen(3000); 在这里我获取我手机的是 Mozilla/5.0 (iPhone; CPU iPhone OS 7_1_2 like Mac OS X) AppleWebKit/537.51.2 (KHTML, like Gecko) Mob ile/11D257 MicroMessenger/6.1 NetType/WIFI 二