“This is the 15th day of my participation in the Gwen Challenge in November. Check out the details: The Last Gwen Challenge in 2021.”

In the last article, I mentioned that reverse proxy is used for load balancing, and IT occurred to me that forward proxy can also be said, perhaps many people are confused about what the difference is?

So this article will use the example of borrowing money to explain what is the forward agent, what is the reverse agent

Forward agent

A forward proxy is a server that sits between the client and the target server, which is a proxy server

In order for a client to fetch content from a target server, but the client cannot access the target server directly due to limitations, the client can send a request to a proxy server and specify the target server

Once the proxy server receives the request, it forwards the request to the target server and returns the obtained content to the client

It will be easy to understand if we use the analogy of borrowing money

Xiao Ming wanted to borrow money from a boss, but xiao Ming couldn’t talk to the boss about borrowing money because he was too poor

However, Xiao Ming was very smart. He knew the secretary around the boss, and then he communicated with the secretary to make the loan clear to the secretary, who then went to borrow money from the boss

Throughout the link, Xiao Ming reached the purpose of borrowing money, and the boss’s money was also lent out. However, the boss did not know who was borrowing money, but he only knew that the money was given to the secretary

A forward proxy is usually used on the client side to help the client access server resources that cannot be accessed by the client

Application scenarios of forward proxy

  • You can override the client’s own access restrictions
  • Can improve the speed of accessing the server
  • You can hide the real IP address of the client

First and third, the forward proxy server helps the client to access the server without the server knowing who the client is

How to improve the speed of accessing the server?

In general, a forward proxy server will have a hardware buffer on it and will put some of the client’s requests into the buffer

When other clients come in for access, the forward bring server can send data from the buffer to the client, thus increasing access speed

The reverse proxy

A reverse proxy is also a server that sits between the client and the target server

Reverse proxy refers to the use of proxy servers to receive Internet connection requests and then forward these requests to multiple internal servers

The proxy server is a reverse proxy server, and the result from the server is returned to the corresponding client on the Internet request

Again, it’s a borrowing case

The boss wanted to lend out the money, but the boss was too lazy to go to the borrowers himself, so he gave the money to an institution that would lend out his own money

At this time, Xiao Ming is still short of money, so he found an organization to borrow money, xiao Ming borrowed this money, in fact, is the boss, but Xiao Ming will not know who this money is, he only know that the organization lent him

This is called a reverse proxy, which is usually used on the server side to perform load balancing on the server side

The application scenario of reverse proxy is self-evident, and the forward proxy has the following points:

  • You can perform load balancing
  • Can improve the speed of accessing the server
  • You can hide the real IP address of the server
  • Can be the security of the server

The first three points are easy to understand. The first point was mentioned in the previous article. What about the fourth point?

External requests are sent to the proxy server first and then to the internal server. Therefore, security functions such as anti-ddos, IP whitelist, and encryption can be implemented on the proxy server

The difference between forward and reverse proxies

Having looked at the above examples, let’s briefly compare the differences between forward and reverse proxies

Forward proxy, which belongs to the client proxy, the server does not know who accesses it

Reverse proxy, used for the server, belongs to the server proxy. The client does not know which server it is accessing

When we look at forward and reverse proxies, we just think about borrowing money

Today is here, learning, if there is a deviation, please correct

Welcome to like, follow and favorites

Friends, your support and encouragement, I insist on sharing, improve the quality of the power

All right, that’s it for this time

Technology is open, our mentality, should be more open. Embrace change, live in the sun, and strive to move forward.

I am Nezha, welcome to like, see you next time ~