This is a simple JavaScript code designed to determine the origin domain of incoming requests to a server and perform port forwarding to the specified port for that domain.
- First, install the dependencies:
npm install
# veya
pnpm install
# veya
yarn install
-
Configure the proxy settings in the proxy.js file. You can specify the mapping of origin domains to target ports in this file.
-
Run the proxy middleware:
node .
The proxy will now listen for incoming requests and forward them to the appropriate port based on the origin domain.
- Clone the repository and configure the proxy as mentioned above.
- Start the proxy middleware using "node .". 3 Incoming requests to the server will be routed to the specified target ports based on the origin domain.
If you want to contribute to this project, you can follow these steps:
- Fork this repository and run it on your own project.
- Make your changes and add descriptive comments.
- Create a pull request.
This project is licensed under the MIT License. For more information, see the LICENSE file.
For any questions or feedback, you can reach us at [email protected] or