CONNECT
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
HTTP CONNECT
方法可以开启与所请求资源之间的双向沟通的通道。它可以用来创建隧道(tunnel)。
例如,CONNECT
可以用来访问采用了 SSL(HTTPS)协议的站点。客户端要求 HTTP 代理服务器将 TCP 连接作为通往目的主机的隧道。之后该服务器会代替客户端与目的主机建立连接。连接建立好之后,代理服务器会面向客户端发送或接收 TCP 数据流。
CONNECT
是一个逐跳(hop-by-hop)的方法。
语法
http
CONNECT www.example.com:443 HTTP/1.1
示例
一些代理服务器在创建隧道时会要求进行身份验证。参见 Proxy-Authorization
标头。
http
CONNECT server.example.com:80 HTTP/1.1
Host: server.example.com:80
Proxy-Authorization: basic aGVsbG86d29ybGQ=
规范
Specification |
---|
HTTP Semantics # CONNECT |
浏览器兼容性
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
CONNECT |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.