HTTP响应如何找到正确的浏览器窗口的方式? [英] How does a HTTP response find its way to the correct browser window?

查看:109
本文介绍了HTTP响应如何找到正确的浏览器窗口的方式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果您打开了两个浏览器窗口,并分别用于浏览到另一个网站,那么软件如何知道哪个HTTP响应属于哪个浏览器实例?

If you have two browser windows open and you use each to navigate to a different website, then how does the software know which HTTP response belongs to which browser instance?

似乎是通过入站TCP端口号进行区分的.但是不涉及TCP/UDP的网络消息呢?例如,如果您打开两个终端应用程序,并使用这两个应用程序将ping消息发送到同一远程服务器,则回复如何找到通往其终端实例的方式?

It seems that the distinction is made by the inbound TCP port numbers. But what about network messages that don't involve TCP/UDP? For example, if you open two terminal applications and use both send a ping message to the same remote server, how does the reply find its way to its terminal instance?

推荐答案

通常,每个浏览器实例都会创建自己的套接字与服务器进行通信.尽管所有套接字的出站端口都相同(通常是TCP 80或443),但是它们的入站端口却不同.因此,由于服务器将响应发送到不同的入站端口,因此服务器响应请求时不会发生冲突.

Typically, each browser instance creates its own socket to communicate with the server. Though the outbound port of all the sockets is the same (usually TCP 80 or 443), their inbound ports are different. Thus, there are no conflicts when the server responds to the requests, since the responses are sent to different inbound ports.

ping之类的工具使用 ICMP数据包,它们提供了自己独特的方式识别正在调用的应用程序(唯一的标识符和序列号).

Tools like ping use ICMP packets, which provide their own way to uniquely identify the calling application (a unique identifier and a sequence number).

这篇关于HTTP响应如何找到正确的浏览器窗口的方式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆