如何知道用户使用的浏览器?
我们已经开始开发位置感知紧急服务的应用程序。用户可以通过电脑、智能手机甚至WAP连接。我们想要使用云服务器(GAE 或 AWS)。我们希望针对用户的设备优化网站。
我无法确切地知道如何知道用户正在使用的设备或浏览器。从apache中,通过分析浏览器请求,我们可以知道浏览器类型。但如何在 GAE 或 AWS 等云服务器中学习这一点呢?有没有其他方法可以了解用户正在使用哪种浏览器或设备?另外是否可以知道 GAE 或 AWS 中用户的 IP 地址?
提前致谢。
We have started developing an application for location aware emergency service. The users can connect through computer,smart phone or even through WAP. We want to use cloud servers (GAE or AWS). We want to optimize the site for the user's device.
I can not find out exactly how to know the device or the browser the user is using. From apache, by analyzing browser request, we could know the browser type. But how to learn that in Cloud servers like GAE or AWS? Is there any other way to learn which browser or device the user is using? Also is it possible to know the ip address of the user in GAE or AWS?
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我没有在云中编程的经验,但请求标头(其中
USER_AGENT
)来自客户端,并且应该照常出现。对于 GAE / Python,答案就在这个问题中:User-Agent in Google App引擎 python
对于 GAE / Java, 中有提示GAE 文档。 必须有一个包含所有标头的请求对象。
I have no experience with programming in the cloud, but the request headers (among them
USER_AGENT
) come from the client and should be present as usual.For GAE / Python, the answer is in this question: User-Agent in Google App Engine python
For GAE / Java, a hint is in the GAE docs. There must be a request object containing all the headers.