[计算机网络]–代理服务器原理

代理服务器:

代理服务器(Proxy Server)就是个人网络和因特网服务商之间的中间代理机构,它负责转发合法的网络信息,并对转发进行控制和登记。目前使用的因特网是一个典型的客户机/服务器结构,当用户的本地机与因特网连接时,通过本地机的客户程序比如浏览器或者软件下载工具发出请求,远端的服务器在接到请求之后响应请求并提供相应的服务。在使用网络浏览器浏览网络信息的时候,如果使用代理服务器,浏览器就不是直接到Web服务器去取回网页,而是向代理服务器发出请求,由代理服务器取回浏览器所需要的信息。

代理服务器位于客户端和服务器之间。对于远程服务器来说,代理服务器是客户端,它向服务器发出各种服务应用;对于客户端来说,代理服务器就是服务器。它接受客户的申请并提供相应的服务。也就是说,客户端访问互联网时发出的请求不再直接发送到远程服务器,而是发送到代理服务器,代理服务器向远程服务器提出相应的应用,接收远程服务器提供的数据并将其保存在自己的硬盘上,然后使用这些数据向客户端提供相应的服务。

[En]

The proxy server is between the client and the server. for the remote server, the proxy server is the client, which makes all kinds of service applications to the server; for the client, the proxy server is the server. it accepts applications from clients and provides corresponding services. In other words, the request made by the client when accessing the Internet is no longer sent directly to the remote server, but is sent to the proxy server, and the proxy server puts forward the corresponding application to the remote server, receives the data provided by the remote server and saves it on its own hard disk, and then uses the data to provide the corresponding service to the client.

代理服务器是建立在TCP/IP协议应用层上的一种服务软件,与专线接入中用到的路由器是两个不同的概念。路由器是连接在网络中的一台硬件设备,它是工作在TCP/IP协议的IP层上,主要起寻径作用。代理服务器软件一般安装在一台性能比较突出且装有调制解调器和网卡的计算机上。在内部局域网中的每一台客户机都必须拥有一个独立的IP地址,而且事先必须在客户机软件上配置使用代理服务器并指向代理服务器的IP地址和服务端口号。当代理服务器启动时,将利用一个名为WINSOCK的动态连接程序来开辟一个指定的端口,等待用户的访问请求。

代理服务器的配置包括两个部分:服务器端与客户端。服务器端的配置包括用户的创建、管理、监控,帐号的统计、分析与查询等设置。但这项工作通常是由因特网服务商负责或者是由专门的网络管理员来做的,对于我们普通的拨号用户来说,代理服务器的配置其实就是指客户端的配置。以后,其他的客户机访问相同的信息时,就不用和ISP进行联系,直接从代理服务器上就可以取得信息了。

使用代理服务器有很多好处,通过代理服务器可以使公司内部网络与INTERNET实现安全连接。

1、提高访问速度

通常代理服务器都设置一个较大的硬盘缓冲区(可能高达几个GB或更大),当有外界的信息通过时,同时也将其保存到缓冲区中,当其他用户再访问相同的信息时,则直接由缓冲区中取出信息,传给用户,以提高访问速度。

2、方便对用户的管理

通过代理服务器,用户可以设置用户验证和记帐功能,对用户进行记帐,没有登记的用户无权通过代理服务器访问Internet网。并对用户的访问时间、访问地点、信息流量进行统计。

3、节省IP开销

使用代理服务器时,所有用户对外只占用一个IP,所以不必租用过多的IP地址,降低网络的维护成本。

4、能加快对网络的浏览速度

代理服务器接收远程服务器提供的数据,并将其保存在自己的硬盘上。如果许多用户同时使用此代理服务器,他们对Internet站点的所有要求都将通过此代理服务器。当有人访问站点时,被访问站点上的内容将保存在代理服务器的硬盘上。如果下次有人访问该网站,它将被保存在代理服务器的硬盘上。此内容直接从代理服务获得,而不必再次连接到远程服务器。因此,可以节省带宽,提高访问速度。

[En]

The proxy server receives the data provided by the remote server and saves it on its own hard disk. If many users use this proxy server at the same time, all their requirements for the Internet site will go through this proxy server. When someone visits a site, the content on the visited site will be saved on the hard disk of the proxy server. If someone visits the site next time, it will be saved on the hard disk of the proxy server. This content is obtained directly from the proxy service without having to connect to the remote server again. Therefore, it can save bandwidth and improve access speed.

5、可以作为防火墙

代理服务器可以保护局域网的安全,起到防火墙的作用:对于使用代理服务器的局域网来说,在外 部看来只有代理服务器是可见的,其他局域网的用户对外是不可见的,代理服务器为局域网的安全起到了屏障的作用。另外,通过代理服务器,用户可以设置IP地 址过滤,限制内部网对外部的访问权限。同样,代理服务器也可以用来限制封锁IP地址,禁止用户对某些网页的访问。

Original: https://blog.51cto.com/u_15776588/5644670
Author: wx63118e2bb7416
Title: [计算机网络]–代理服务器原理

原创文章受到原创版权保护。转载请注明出处:https://www.johngo689.com/508241/

转载文章受原作者版权保护。转载请注明原作者出处!

(0)

大家都在看

亲爱的 Coder【最近整理,可免费获取】👉 最新必读书单  | 👏 面试题下载  | 🌎 免费的AI知识星球