Bridge46 is simple bridge between IPv4 and IPv6 it's works by listen on IPv4 well known services and forward the traffic to IPv6 services
- HTTP (configurable ports, default: 80)
- HTTPS (configurable ports, default: 443)
- Websocket (ws) and Secure Websocket (wss) over HTTP/HTTPS
- Minecraft (TCP) (configurable port, default: 25565)
- Clone the repository
- Run the following command to build and run the project
cargo runBridge46 supports configurable ports via command line arguments:
# Default ports (80, 443, 25565)
cargo run
# Custom single ports
cargo run -- --http-ports 8080 --https-ports 8443 --minecraft-ports 25566
# Port ranges (supports ranges like 80-90)
cargo run -- --http-ports 80-85 --https-ports 443-450
# Comma-separated ports
cargo run -- --http-ports 80,8080,9000 --https-ports 443,8443,9443 --minecraft-ports 25565,25566
# Mixed single ports and ranges (space-separated)
cargo run -- --http-ports 80 8080-8082 --https-ports 443 8443-8445
# Mixed single ports and ranges (comma-separated)
cargo run -- --http-ports 80,8080-8082,9000 --https-ports 443,8443-8445,9443 --minecraft-ports 25565,25570-25572
# Multiple HTTP/HTTPS ports (space-separated)
cargo run -- --http-ports 80 8080 --https-ports 443 8443--http-ports: HTTP ports to listen on (supports ranges and comma-separated values) [default: 80]--https-ports: HTTPS ports to listen on (supports ranges and comma-separated values) [default: 443]--minecraft-ports: Minecraft ports to listen on (supports ranges and comma-separated values) [default: 25565]
Single ports:
8080: Creates listener on port 808080,8080,9000: Creates listeners on ports 80, 8080, 9000
Port ranges:
80-85: Creates listeners on ports 80, 81, 82, 83, 84, 85443-450: Creates listeners on ports 443, 444, 445, 446, 447, 448, 449, 4508080-8082: Creates listeners on ports 8080, 8081, 8082
Mixed single ports and ranges:
80,8080-8082,9000: Creates listeners on ports 80, 8080, 8081, 8082, 9000443,8443-8445,9443: Creates listeners on ports 443, 8443, 8444, 8445, 944325565,25570-25572: Creates listeners on ports 25565, 25570, 25571, 25572
Note: Port ranges are limited to a maximum of 1000 ports to prevent resource exhaustion.
To see all available CLI options:
cargo run -- --helpUsage: bridge46 [OPTIONS]
Options:
--http-ports <HTTP_PORTS>
HTTP ports to listen on (supports ranges like 80-90) [default: 80]
--https-ports <HTTPS_PORTS>
HTTPS ports to listen on (supports ranges like 443-450) [default: 443]
--minecraft-ports <MINECRAFT_PORTS>
Minecraft ports to listen on (supports ranges and comma-separated values) [default: 25565]
-h, --help
Print help
-V, --version
Print version
- Add A record of IPv4 of the server to your DNS records (make sure you have IPv6 AAAA record too)
- Now you can access your IPv6 services using IPv4
- Pull the image from docker hub (optional because the image will be pulled automatically when you run the container)
docker pull xlmnxp/bridge46:latest- Run the image with default ports
docker run -d -p 80:80 -p 443:443 -p 25565:25565 --name bridge46 xlmnxp/bridge46:latest- Run with custom ports
# Custom single ports
docker run -d -p 8080:8080 -p 8443:8443 -p 25566:25566 --name bridge46 xlmnxp/bridge46:latest --http-ports 8080 --https-ports 8443 --minecraft-ports 25566
# Port ranges
docker run -d -p 80-85:80-85 -p 443-445:443-445 -p 25565-25567:25565-25567 --name bridge46 xlmnxp/bridge46:latest --http-ports 80-85 --https-ports 443-445 --minecraft-ports 25565-25567
# Comma-separated ports
docker run -d -p 80:80 -p 8080:8080 -p 443:443 -p 8443:8443 -p 25565:25565 -p 25566:25566 --name bridge46 xlmnxp/bridge46:latest --http-ports 80,8080 --https-ports 443,8443 --minecraft-ports 25565,25566Optionally you can pass the following environment variables to the container
| Environment Variable | Description | Default Value |
|---|---|---|
| DNS_SERVER | specify the DNS server to use | 1.1.1.1:53 |
| BIND_ADDRESS | specify the address to bind to | :: |
| BRIDGE46_IPV4 | specify the IPv4 address for service validation of A Records point to the service (see #1) | empty |
| BRIDGE46_IPV6 | specify the IPv4 address for service validation of AAAA Records point to the service (see #1) | empty |
- Add A record of IPv4 of the server to your DNS records (make sure you have IPv6 AAAA record too)
This project is licensed under the MIT License - see the LICENSE file for details