What is the use of node agent?

WBOY
Release: 2022-03-08 17:07:13
Original
1366 people have browsed it

In node, the proxy is used to obtain content from the original server. The client sends a request to the proxy and specifies the target, which is the original server. Then the proxy forwards the request to the original server and returns the obtained content to client.

What is the use of node agent?

The operating environment of this article: Windows 10 system, nodejs version 12.19.0, Dell G3 computer.

What is the use of node agent

Forward agent

Forward agent, which is the legendary agent, works like a Springboard, to put it simply, I am a user and I cannot access a certain website, but I can access a proxy server. This proxy server can access the website that I cannot access. So I first connected to the proxy server and told him that I needed to The content proxy server that cannot access the website goes to get it back and then returns it to me.

From the perspective of the website, there is only one record when the proxy server comes to retrieve the content. Sometimes it is not known to be the user's request, and the user's information is also hidden. This depends on whether the proxy tells the website or not.

The conclusion is that a forward proxy is a server between the client and the origin server. In order to obtain content from the origin server, the client sends a request to the proxy and specifies the target (origin server). The proxy then forwards the request to the origin server and returns the obtained content to the client. The client must make some special settings to use the forward proxy.

The concept of reverse proxy

Continue with the example: a user visits http://ooxx.me/readme but the readme page does not exist on ooxx.me. He is It's normal to secretly retrieve it from another server and then spit it out to the user as your own content, but the user doesn't know it. Users are generally stupid.

The server corresponding to the domain name ooxx.me mentioned here has a reverse proxy function. The conclusion is that a reverse proxy is just the opposite. It acts like the original server to the client, and the client does not need to make any special settings. The client sends a normal request to the content in the reverse proxy's namespace (name-space), and then the reverse proxy will determine where to forward the request (original server) and return the obtained content to the client, like these The content is originally its own.

The difference between the two

In terms of use

The typical use of forward proxy is to provide a way for LAN clients within the firewall to access the Internet. Forward proxies can also use buffering features to reduce network usage. A typical use of a reverse proxy is to provide access to a server behind a firewall to Internet users. A reverse proxy can also provide load balancing for multiple servers on the backend, or buffering for slower servers on the backend. In addition, reverse proxy can also enable advanced URL policies and management technologies, so that web pages in different web server systems exist in the same URL space at the same time.

In terms of security:

The forward proxy allows the client to access any website through it and hide the client itself, so you must take security measures to ensure that only authorized clients are Provide services. Reverse proxies are transparent to the outside world, and visitors do not know that they are accessing a proxy.

Recommended learning: "nodejs video tutorial"

The above is the detailed content of What is the use of node agent?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!