Build your own proxy server from scratch with Node.js - A proxy is a gateway between a client and the entire internet. But there are several use cases for a proxy. For example: if you’re inside a corporate network, there are 99% chances that you’re behind a proxy which controls your access to the internet.
A proxy is a gateway between a client and the entire internet. But there are several use cases for a proxy. For example: if you’re inside a corporate network, there are 99% chances that you’re behind a proxy which controls your access to the internet by allowing and restricting what you can visit and what you can’t visit. Such kind of proxy is known as forward proxy.
If we talk about server side, let’s say you are having an application deployed on some servers and are exposed to internet, but you want to implement a middleman which can prevent the direct exposure of your application servers to the internet, chances are you want to have a proxy server which can take requests from the clients on internet and forward them to your application servers, and then send the response back to them. Such kind of proxy is known as reverse proxy.
Let’s understand this by a simple example. You are in a company having computers A, B and C and these computers want to access website X, but the administrator has blocked the direct access to internet for corporate safety but he has setup a proxy server P through which internet can be accessed.
Forward proxy graphical representation
The proxy server referred in the above scenario is the forward proxy server.
The main goal of this blog is to explain the “Architecture of Nodejs” and to know how the Nodejs works behind the scenes. Generally, most of the server-side languages, like PHP, ASP.NET, Ruby, and including Nodejs follows multi-threaded architecture. That means for each client-side request initiates a new thread or even a new process.
Looking to build dynamic, extensively featured, and full-fledged web applications? **[Hire NodeJs Developer](https://hourlydeveloper.io/hire-dedicated-node-js-developer/ "Hire NodeJs Developer")** to create a real-time, faster, and scalable...