It is a server that forwards client request to the correct web server for processing, and also forwards server response to the correct web client browser for presentation.
- Usage
- Coding style
- Prerequisites
- Install dependencies
- Lint the project
- Build the project
- Automatically build the project on save
- Automatically restart the project on change
- Start the project
- Test the project with code coverage analysis
- Automatically test the project with code coverage analysis on change
reverse-proxy <config-file-path>
config-file-path
: It must exists and must not ends with either '/' or '\'.
A config file passed in must follow the format below:
{
"keyPath": {
"type": "string",
"required": true,
"format": "[^/\\]$"
},
"certPath": {
"type": "string",
"required": true,
"format": "[^/\\]$"
},
"routes": {
"type": "array",
"required": true,
"value": [
{
"hostname": {
"type": "string",
"required": true
},
"target": {
"type": "string",
"required": true
}
}
]
}
}
{
"keyPath": "test/key.pem",
"certPath": "test/cert.pem",
"routes": [
{
"hostname": "example.dynv6.net",
"target": "http://localhost:1024"
},
{
"hostname": "www.example.dynv6.net",
"target": "http://localhost:1024"
},
{
"hostname": "abcdefg.dynv6.net",
"target": "http://localhost:1025"
},
{
"hostname": "www.abcdefg.dynv6.net",
"target": "http://localhost:1025"
}
]
}
This project follows Javascript Standard Style. Please familiarize yourself with the rules provided in the coding style and
make sure all the proposed code changes in your commits are conforming to the style before making a merge request. You can also make use of
StandardJS - Javascript Standard Style which is a Visual Studio Code plugin and npm run lint
command under the
Lint the project section to support you.
- Windows 11 or Linux
- Visual Studio Code with plugins:
- EditorConfig for VS Code
- Markdown All in One
- StandardJS - Javascript Standard Style
- YAML
- Node.js 16.13.2 and later
npm install
npm run lint
npm run build
npm run build:watch
npm run dev <config-file-path>
npm start <config-file-path>
npm test
npm run test:watch