DockyMcProxy is a Rust-based project that simplifies the process of setting up a local HTTPS reverse proxy using nginx. It's a handy tool for developers who want to mimic a production environment locally. π οΈ
- Automatic HTTPS setup with Let's Encrypt. π
- CLI for easy management. π₯οΈ
- Easy setup of subdomains and ports for local development. π
- Built with Rust for performance and safety. π¦
- Docker support for portability. π³
- Uses traefik.me for certificates and DNS. π
The easiest way to use DockyMcProxy is to run it with Docker. You can also run it directly on your local machine using the Rust programming language. Here's how to use it with both methods.
In this example, D_EXAMPLE=8080
sets up a subdomain example.traefik.me
that redirects to localhost:8080
.
docker run --rm --network=host --name "dockymcproxy" -e "D_EXAMPLE=8080" -d unit214/dockymcproxy
When you are running DockyMcProxy on Docker, you can access the CLI by running the following command:
docker exec -it <container_id> dmp <command>
If you are running DockyMcProxy directly on your local machine, you can use the following command:
cargo run -- <command>
The application supports the following commands:
init
: Initializes the environment by creating new domains for each environment variable starting withD_
.list
: Lists all the existing subdomains and their corresponding ports.add
: Adds a new subdomain and port. Use the--force
or-f
flag to overwrite an existing subdomain.remove
: Removes an existing subdomain.
Here are some examples of how to use these commands:
# Add a new subdomain
cargo run -- add --subdomain example --port 8080
# or
docker exec dockymcproxy dmp add --subdomain example --port 8080
# Remove a subdomain
cargo run -- remove --subdomain example
# or
docker exec dockymcproxy dmp remove --subdomain example
- Rust programming language
- Cargo package manager
- Nginx web server
Clone the repository to your local machine:
git clone https://github.com/unit214/docky-mc-proxy.git
Navigate to the project directory:
cd docky-mc-proxy
Build the project:
cargo build
Your contributions are welcome! Please read CONTRIBUTE.md for details on the process.
This project is licensed under the MIT License - see the LICENSE file for details.