- 浏览: 435019 次
- 性别:
- 来自: 北京
文章分类
- 全部博客 (144)
- java (32)
- Flex (11)
- linux (15)
- 思维至上 (2)
- 生活 (4)
- spring2.5.5 (3)
- Design pattern (0)
- jdk1.6 (1)
- erlang (14)
- mysql (5)
- nginx (10)
- 互联网 (1)
- 用户体验 (0)
- jvm (8)
- hibernate (0)
- oracle (0)
- mvn (2)
- 23种常用设计模式详细讲解及实例 (1)
- nosql (1)
- mongodb (2)
- thrift (1)
- 负载均衡 (1)
- Objective-c (1)
- fuck (1)
- resin (3)
- log4j (2)
- android (1)
- jps (0)
- lucene (2)
- rsync (1)
- python (1)
- java性能分析 (1)
- spring (1)
- zookeeper (2)
- error (1)
- 算法 (1)
- hudson (1)
- svn (1)
- maven (1)
- svn server (2)
- swap linux (1)
- 协同过滤 (1)
- 邮件系统 (1)
最新评论
-
cheetah747:
我也遇到这个问题了,不过我是直接把第三方jar放到工程文件的l ...
JAVA NoClassDefFoundError: -
dxm1986:
hillfallshore 写道亲 你这是杜撰的小说吗?完全是 ...
面试有感 -
dxm1986:
mengda1027 写道从实习生到高级java到架构师,是在 ...
面试有感 -
dxm1986:
kljjack 写道一个编程十几年,每年看几十本技术书籍,技术 ...
面试有感 -
dxm1986:
轻指飞扬 写道呵呵,挺好玩的~ 我怎么感觉你招人不是很有诚意嘛 ...
面试有感
http://en.wikipedia.org/wiki/User_agent
User agent
In computing, a user agent is software (a software agent) that is acting on behalf of a user. For example, an email reader is a Mail User Agent, and in the Session Initiation Protocol (SIP), the term user agent refers to both end points of a communications session.[1]
In many cases, a user agent acts as a client in a network protocol used in communications within a client–server distributed computing system. In particular, the Hypertext Transfer Protocol identifies the client software originating the request, using a "User-Agent" header, even when the client is not operated by a user. The SIP protocol (based on HTTP) followed this usage.
Contents[hide] |
[edit] User-agent identification
When software agent operates in a network protocol, it often identifies itself, its application type, operating system, software vendor, or software revision, by submitting a characteristic identification string to its operating peer. In HTTP, SIP, and SMTP/NNTP[2] protocols, this identification is transmitted in a header field User-Agent. Bots, such as Web crawlers, often also include a URL and/or e-mail address so that the Webmaster can contact the operator of the bot.
In HTTP, the User-Agent string is often used for content negotiation, where the origin server selects suitable content or operating parameters for the response. For example, the User-Agent string might be used by a web server to choose variants based on the known capabilities of a particular version of client software.
The User-Agent string is one of the criteria by which Web crawlers may be excluded from accessing certain parts of a Web site using the Robots Exclusion Standard (robots.txt file).
[edit] Possible privacy issue
As with many other HTTP request headers, the information in the "User-Agent" string contributes to the information that the client sends to the server, since the string can vary considerably from user to user.[3]
[edit] Format
The User-Agent string format is currently specified by Section 14.43 of RFC 2616 (HTTP/1.1) The format of the User-Agent string in HTTP is a list of product tokens (keywords) with optional comments. For example if your product were called WikiBrowser, your user agent string might be WikiBrowser/1.0 Gecko/1.0. The "most important" product component is listed first. The parts of this string are as follows:
- Product name and version (WikiBrowser/1.0)
- Layout engine and version(Gecko/1.0). In this case, this indicates the Layout engine and version.
Unfortunately, during the browser wars, many web servers were configured to only send web pages that required advanced features to clients that were identified as some version of Mozilla.
For this reason, most Web browsers use a User-Agent value as follows: Mozilla/[version] ([system and browser information]) [platform] ([platform details]) [extensions]. For example, Safari on the iPad has used the following:
Mozilla/5.0 (iPad; U; CPU OS 3_2_1 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Mobile/7B405
The components of this string are as follows:
- Mozilla/5.0: Previously used to indicate compatibility with the Mozilla rendering engine
- (iPad; U; CPU OS 3_2_1 like Mac OS X; en-us): Details of the system in which the browser is running
- AppleWebKit/531.21.10: The platform the browser uses
- (KHTML, like Gecko): Browser platform details
- Mobile/7B405: This is used by the browser to indicate specific enhancements that are available directly in the browser or through third parties. An example of this is Microsoft Live Meeting which registers an extension so that the Live Meeting service knows if the software is already installed, which means it can provide a streamlined experience to joining meetings.
[edit] User agent spoofing
The popularity of various Web browser products has varied throughout the Web's history, and this has influenced the design of Web sites in such a way that Web sites are sometimes designed to work well only with particular browsers, rather than according to uniform standards by the World Wide Web Consortium (W3C) or the Internet Engineering Task Force (IETF). Web sites often include code to detect browser version to adjust the page design sent according to the user agent string received. This may mean that less-popular browsers are not sent complex content (even though they might be able to deal with it correctly) or, in extreme cases, refused all content.[4] Thus, various browsers have a feature to cloak or spoof their identification to force certain server-side content. For example, the Android browser identifies itself as Safari in order to aid compatibility.[5]
Other HTTP client programs, like download managers and offline browsers, often have the ability to change the user agent string.
Spam bots and Web scrapers often use fake user agents.
At times it has been popular among Web developers to initiate Viewable With Any Browser campaigns,[6] encouraging developers to design Web pages that work equally well with any browser.
A result of user agent spoofing may be that collected statistics of Web browser usage are inaccurate.
[edit] User agent sniffing
The term user agent sniffing refers to the practice of Web sites showing different content when viewed with a certain user agent. On the Internet, this will result in a different site being shown when browsing the page with a specific browser. A useful example of this is Microsoft Exchange Server 2003's Outlook Web Access feature. When viewed with Internet Explorer 6 (or newer), more functionality is displayed compared to the same page in any older browsers, because older browsers could not render the same content.[citation needed] User agent sniffing is mostly considered poor practice, since it encourages browser-specific design and penalizes new browsers with unrecognized user agent identifications. Instead, the W3C recommends creating HTML markup that is standard,[7] allowing correct rendering in as many browsers as possible, and to test for specific browser features rather than particular browser versions or brands.[8]
Web sites specifically targeted towards mobile phones, like NTT DoCoMo's I-Mode or Vodafone's Vodafone Live! portals, often rely heavily on user agent sniffing, since mobile browsers often differ greatly from each other. Many developments in mobile browsing have been made in the last few years,[when?] while many older phones that do not possess these new technologies are still heavily used. Therefore, mobile Web portals will often generate completely different markup code depending on the mobile phone used to browse them. These differences can be small, e.g., resizing of certain images to fit smaller screens, or quite extensive, e.g., rendering of the page in WML instead of XHTML.
[edit] Encryption strength notations
Web browsers created in the United States, such as Netscape Navigator and Internet Explorer, use the letters U, I, and N to specify the encryption strength in the user agent string. Until 1996, when the United States government allowed encryption with keys longer than 40 bits to be exported, vendors shipped various browser versions with different encryption strengths. "U" stands for "USA" (for the version with 128-bit encryption), "I" stands for "International" — the browser has 40-bit encryption and can be used anywhere in the world — and "N" stands (de facto) for "None" (no encryption).[9] Following the lifting of export restrictions, most vendors supported 256-bit encryption.
[edit] See also
- Robots Exclusion Standard
- Web crawler
- Wireless Universal Resource File (WURFL)
- User Agent Profile (UAProf)
- Apache Mobile Filter
- Browser sniffing
[edit] References
- ^ RFC 3261, SIP: Session Initiation Protocol, IETF, The Internet Society (2002)
- ^ Netnews Article Format. IETF. November 2009. sec. 3.2.13. RFC 5536.
- ^ Peter Eckersley. "Browser Versions Carry 10.5 Bits of Identifying Information on Average", Electronic Frontier Foundation, 27 January 2010. Retrieved 25 August 2011.
- ^ Burstein complaining "... I've been rejected until I come back with Netscape"
- ^ http://androidcommunity.com/forums/f8/android-browser-reports-itself-as-apple-safari-4701/
- ^ "Viewable with Any Browser" campaign
- ^ Pemberton, Stephen. "W3C Markup Validation Service". W3C. Retrieved 2011-10-18.
- ^ Clary, Bob (10 February 2003). "Browser Detection and Cross Browser Support". Mozilla Developer Center. Mozilla. Retrieved 2009-05-30.
- ^ Zawinski, Jamie (1998-03-28). "user-agent strings (obsolete)". mozilla.org. Retrieved 2010-01-08.
发表评论
-
Nginx agent log 中 IE的浏览器版本
2012-04-19 10:13 2929http://www.useragentstring.com/ ... -
基于nginx access 的log 分析
2012-03-22 17:27 21131 设置 nginx access.log 格式 ... -
nginx 按网站用户尾号设置白名单
2011-12-27 17:48 1804nginx 按网站用户尾号设置白名单 其实这个需求很常 ... -
nginx x-forwarded-for的深度挖掘
2011-08-25 10:21 1335nginx x-forwarded-for的 ... -
nginx转发不带参数
2011-07-23 20:34 3715Nginx: rewrite重定向的参数处理问题 星期日, ... -
Nginx无需重启动态加载配置文件
2011-04-18 21:54 15347重新刷新了一下nginx的配置文件,禁止在403,404等 ... -
nginx proxy_pass location 为正则表达式的问题
2011-04-18 21:35 3687http://blog.helosa.org/2 ... -
nginx 反向代理,动静态请求分离,proxy_cache缓存及缓存清除
2011-03-18 18:04 8935今天工作之余,继续拘捣鼓了一下nginx,尝试了一下,ngin ... -
神奇的nginx
2011-03-16 15:46 1878一,设置默认图片 ...
相关推荐
还在为 user agent swicher 只有IPHONE、IE、search robot这三种烦恼吗? 导入这个列表吧,包括了目前主流的浏览器标识 使用方法 先安装好,重启火狐浏览器之后,打开菜单栏“工具”“Dafault User Agent”“Edit ...
5. **`useragentswitcher.xml`**: - 这个文件可能是某种工具(如浏览器插件)的配置文件,用于存储多种预定义的User Agent字符串。 - 用户可以通过切换不同的User Agent设置,方便地在多种身份间切换,适用于测试...
user agent switcher是火狐手机ua模拟组件,这个包含了user agent switcher的ua列表和上万种手机UA列表,您可以自己动手书写自己先要的模拟的ua信息。user agent switcher很不错,希望能给大家带来帮助!
python源码 - python-user-agents:浏览器 user agent 解析器 user_agents是一个 Python 库,它提供了一种通过解析 (浏览器/HTTP) 用户代理字符串来识别/检测手机、平板电脑等设备及其功能的简单方法。目标是...
浏览器UA切换 UserAgent UserAgentSwitcher.xml
可用firefox导入 导入之后就可以在浏览器中切换user Agent
重启”Mozilla Firefox“,在Mozilla Firefox顶部的菜单上按右键,选“定制(C)..."->找到一个黑白的地球图标下面写着"User Agent"->把它拖拽到Mozilla Firefox顶部的菜单上->"完成" [网络传输]手机+蓝牙+CMWAP...
3. **绕过限制**:有些网站会针对特定User Agent实施访问限制,伪造User Agent可以规避这些限制。 4. **优化抓取**:在网络爬虫中,改变User Agent可以防止被目标网站识别为机器人并被封锁。 在给定的文件列表中,...
useragentswicher 更新至2014-02-15日为止... 导入这个列表吧,包括了目前主流的浏览器标识 使用方法 先安装好,重启火狐浏览器之后,打开菜单栏“工具”“Dafault User Agent”“Edit User Agents”“Import…”导入
移动User Agent,通常简称为UA(User Agent),是网络浏览器发送到服务器的一个字符串,用于标识访问者所使用的设备、操作系统、浏览器类型及版本等信息。这个字符串对于网站开发者和服务提供商至关重要,因为它允许...
**User-Agent Switcher for Chrome 汉化版**是一款针对谷歌浏览器(Chrome)设计的扩展程序,它允许用户轻松地更改浏览器发送的User-Agent字符串,从而模拟不同设备或浏览器环境来访问网页。这个功能在进行网页开发...
Android等等做测试,就可以试试user agent,这套 Chrome浏览器的扩展程序,能将Chrome伪装成各大家不同的浏览器,让你方便测试初始网页。user agent扩展可以轻松,快捷地修改Chrome浏览器的UA。 支持自动切换模式,...
我还同时提供了一个修改了UA(user agent 用户代理) 的dll文件,再下载并解压后,在C盘 program files 下面的opera文件夹下替换同名文件即可。 注意,启动opera之后,要点击F12键盘,把最下面的识别为internet exploer6...
User Agent String(简称UA字符串)就是一个关键工具,它包含了客户端浏览器的详细信息,如浏览器名称、版本、操作系统等。本资源提供了基于Java和PHP的解决方案,帮助开发者解析和识别UA字符串,从而判断客户端平台...
User-Agent字符串包含了访问网站的客户端信息,如浏览器类型、版本、操作系统等。在Java开发中,有一个名为`User-Agent Utilities`的库,由Harald Walker开发,其版本号可能为2a6db83,这正是我们要讨论的焦点。 这...
浏览器默认样式(User Agent Stylesheet)是指浏览器为了呈现基本的网页结构和内容,预先定义的一系列CSS样式。每个浏览器都有自己的User Agent Stylesheet,用于确保基本的HTML元素在没有明确的CSS定义时,能够以一种...
【浏览器插件-User-Agent Switcher】User Agent Switcher 是一款简洁而高效的浏览器扩展工具。它不受你使用的浏览器或操作系统的限制,让你的网络体验更加流畅。该扩展通过添加一个工具栏按钮,让你能够轻松切换至...