If you are willing to help hiproxy to write documentation, please contact zdying@live.com, thank you!
Introduction
Here is an Example, with a Workspace inside, this workspace contains three basic projects, they use port 8000, 8001 and 8002 respectively.
Meanwhile, a script named server.js is provided to start those three services, use command npm start or node start
The directory structure of this project is as follows:
1 | . |
In directory workspace, three apps exist, with a hosts file for each:
1 | # main-app hosts |
1 | # blog-app hosts |
1 | # news-app hosts |
For blog-app, a rewrite file is included:
1 | # rewrite rules |
…
STEPS
STEP 1: clone codes
The codes of example project is hosted on github, use Git command to clone those codes local
1 | git clone https://github.com/hiproxy/hiproxy-example.git |
STEP 2: install dependencies
Enter the root directory of project hiproxy-example/, install all the third-party dependencies
1 | cd hiproxy-example |
STEP 3: start service
After cloning codes and installing dependencies, start the service provided by example project. Use command in hiproxy-example/:
1 | npm start |
STEP 4: start hiproxy
With all steps above done, start hiproxy to have the first taste of it. Use command in hiproxy-example/:
1 | hiproxy start --https --open --workspace ./workspace |
STEP 5: View test page
After running the command above, a browser window will be opened, with proxy already set. Visit any of the links below: