How to Test a Website Hosted at an Internal Server
Steps
1. Build up a ssh tunnel.
You can achieve it with one command line:
ssh -D 1107 user@host -p port
1107 is a custom forwarding port we use later. Login and go to Step 2.
Now we’re using putty to make it happen.
First of all, input the basic options at the Session page.
As the image shown above, input a source port that is not occupied, and pick the “Dynamic” option. Then click the “Add” button.
Open the session, and login to your server. The tunnel is good to go.
2. Setup your browser.
You can follow the steps shown in the image. Notice that socket port is the same to the one you just enter at Step 1.
3. Edit your local hosts file.
Finally, you can edit your hosts file to resolve domains to the internal ip addresses.
For example:
10.13.0.23 legendctu.github.io
Flush the dns cache if you like. All is done now.
Written on January 21, 2015