httpclient使用什么端口?

发布于 2024-09-12 12:56:13 字数 45 浏览 8 评论 0原文

httpclient使用什么端口?

80、8080、……?

What port does httpclient use?

80, 8080, ....?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

故事灯 2024-09-19 12:56:13

连接中始终涉及两个端口 - 一个在服务器上,另一个在客户端上。

服务器端端口通过 HTTP URL(HTTP 连接的默认值为 80,HTTPS 的默认值为 443),并在主机名后使用主机名:端口表示法指定。

在客户端,事情有点有趣。客户端打开一个临时或动态端口,该端口仅在建立连接时持续有效。客户端端口始终在IANA 为其保留的动态范围(49152 到 65535),通常在较新的操作系统上强制执行(我不确定 Windows XP 是否严格遵循 IANA 指令,但 Vista 和 Windows Server 2008 恰好)。

There are always two ports involved in a connection - one at the server, and another at the client.

The server-side port is specified (and is known to the client) via the HTTP URL (the default is 80 for HTTP connections and 443 for HTTPS) and is specified after the hostname using hostname:port notation.

On the client-side, things are a bit more interesting. Clients open a temporary or dynamic port that lasts only as long as the connection is made. Client-side ports are always opened on the dynamic range (49152 through 65535) reserved for them by IANA, which is usually enforced on the newer operating systems (I'm not sure if Windows XP follows the IANA directive to the letter, but Vista and Windows Server 2008 happen to).

放我走吧 2024-09-19 12:56:13

如果您指的是目标端口,则非安全 (HTTP) 协议的标准是 80,而标准 HTTPS 端口是 443。

就出站客户端端口而言,这在很大程度上无关紧要,将根据可用端口进行选择等(即:没有设置出站端口。)

If you mean the destination port, the standard for the non-secure (HTTP) protocol is 80, whereas the standard HTTPS port is 443.

In terms of the outbound client port, that's largely irrelevant and will be chosen based on what ports are available, etc. (i.e.: There's no set outbound port.)

倾城花音 2024-09-19 12:56:13

标准端口是 80。如果您看到类似 http://example.com:8080 的内容,则表示站点使用不同的端口,在本例中为 8080。

The standard port is 80. If you see something like http://example.com:8080, it means the site is using a different port, in this case 8080.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文