From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- files/zh-cn/web/http/methods/connect/index.html | 85 +++++++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 files/zh-cn/web/http/methods/connect/index.html (limited to 'files/zh-cn/web/http/methods/connect') diff --git a/files/zh-cn/web/http/methods/connect/index.html b/files/zh-cn/web/http/methods/connect/index.html new file mode 100644 index 0000000000..580b9b13f7 --- /dev/null +++ b/files/zh-cn/web/http/methods/connect/index.html @@ -0,0 +1,85 @@ +--- +title: CONNECT +slug: Web/HTTP/Methods/CONNECT +tags: + - 请求方法 + - 隧道 +translation_of: Web/HTTP/Methods/CONNECT +--- +
{{HTTPSidebar}}
+ +

在 HTTP 协议中,CONNECT 方法可以开启一个客户端与所请求资源之间的双向沟通的通道。它可以用来创建隧道(tunnel)。

+ +

例如,CONNECT 可以用来访问采用了 {{Glossary("SSL")}} ({{Glossary("HTTPS")}})  协议的站点。客户端要求代理服务器将 TCP 连接作为通往目的主机隧道。之后该服务器会代替客户端与目的主机建立连接。连接建立好之后,代理服务器会面向客户端发送或接收 TCP 消息流。

+ +

CONNECT 是一个应用范围为点到点的方法。

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Request has bodyNo
Successful response has bodyYes
{{Glossary("Safe")}}No
{{Glossary("Idempotent")}}No
{{Glossary("Cacheable")}}No
Allowed in HTML formsNo
+ +

语法

+ +
CONNECT www.example.com:443 HTTP/1.1
+
+ +

示例

+ +

一些代理服务器在创建隧道时会要求进行身份验证。参见  {{HTTPHeader("Proxy-Authorization")}} 首部。

+ +
CONNECT server.example.com:80 HTTP/1.1
+Host: server.example.com:80
+Proxy-Authorization: basic aGVsbG86d29ybGQ=
+ +

规范

+ + + + + + + + + + + + +
SpecificationTitle
{{RFC("7231", "CONNECT", "4.3.6")}}Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content
+ +

浏览器兼容性

+ + + +

{{Compat("http.methods.CONNECT")}}

+ +

相关内容

+ + -- cgit v1.2.3-54-g00ecf