tmphosts is a lightweight, temporary reverse proxy solution that allows users to easily reroute traffic to different hosts by modifying their local hosts file. Built on Nginx, tmphosts also seamlessly handles HTTP to HTTPS redirection, ensuring a secure browsing experience.
- Docker installed on your system
- Run the Docker container:
docker run -d --name tmphosts -p 80:80 -p 443:443 --restart always huangsen365/tmphosts
- Clone the repository:
git clone https://github.com/huangsen365/tmphosts.git
- Change to the tmphosts directory:
cd tmphosts
- Build the Docker image:
docker build -t tmphosts .
- Run the Docker container:
docker run -d --name tmphosts -p 80:80 -p 443:443 --restart always tmphosts
-
Modify your local hosts file to add entries pointing to the public IP address where tmphosts is running (e.g.,
123.123.123.123 example.com):- Windows: Edit the file
C:\Windows\System32\drivers\etc\hostsusing a text editor with administrator privileges. - Linux & macOS: Edit the file
/etc/hostsusing a text editor with root or sudo privileges.
- Windows: Edit the file
-
Access the websites using their HTTPS versions (e.g.,
https://example.com).
This project is licensed under the MIT License. See the LICENSE file for more information.