How do I use an express HTTP proxy

Develop a static resource service based on nodejsemptyd-server
The appearance of proxy is due to the policy of the browser of the same origin
There are many examples and methods for implementing proxy on the server side to solve cross-domain problems in the production environment
again, waiting for some third party packages to help me deal with it and basically get an out of the box experience
Usually the proxy we are referring to comes from the definition of http1.1. The proxy plays the role of the "middleman". For the client connected to it, it is the server. For the connected server it is the client. It is responsible for sending HTTP messages back and forth between the two ends
When I visit a website through a proxy for A, the proxy is treated as a client with no knowledge of the real client's existence. This hides the client's IP address.
But how they did it is worth checking out. Here's how to write a proxy in native Nodejs

The core idea of ​​the code above is to usewe act as an intermediary, helping us to get data from the destination address and then send the data back. It can be viewed as an agency mode practice in draft mode