Recently I had to clone a git repository on GitHub via an IPv6 only server that I rented at my favourite hosting provider Hetzner. Unfortunately I realized that GitHub still does not support IPv6.
My workaround was setting up a WireGuard VPN with one of my dual-stack servers. An alternative could have been installing Tor to download anonymously.
As I’m by far not the only user with an IPv6 only server looking to download repositories from GitHub, I decided to provide a public proxy server that can be used to access GitHub on an IPv6 network, until GitHub provides native IPv6 support. The proxy is only available on IPv6, to prevent IPv4 users from using unnecessary resources, as they can already clone from GitHub directly.
So how does it work? Let’s assume we want to clone the PHP Chat script I’ve published at https://github.com/DanWin/le-chat-php. Normally cloning the repository would look like this:git clone https://github.com/DanWin/le-chat-php
Due to DOS attacks I have stopped providing the https proxy. If you would like to clone via ssh you can do it like this:git clone git@github-ipv6-proxy.danwin1210.de:DanWin/le-chat-php
Those wanting to use the proxy more permanently and/or clone via https, should add the following to /etc/hosts:
2a01:4f8:c010:d56::2 github.com 2a01:4f8:c010:d56::3 api.github.com 2a01:4f8:c010:d56::4 codeload.github.com 2a01:4f8:c010:d56::6 ghcr.io 2a01:4f8:c010:d56::7 pkg.github.com npm.pkg.github.com maven.pkg.github.com nuget.pkg.github.com rubygems.pkg.github.com 2a01:4f8:c010:d56::8 uploads.github.com 2606:50c0:8000::133 objects.githubusercontent.com www.objects.githubusercontent.com release-assets.githubusercontent.com gist.githubusercontent.com repository-images.githubusercontent.com camo.githubusercontent.com private-user-images.githubusercontent.com avatars0.githubusercontent.com avatars1.githubusercontent.com avatars2.githubusercontent.com avatars3.githubusercontent.com cloud.githubusercontent.com desktop.githubusercontent.com support.github.com 2606:50c0:8000::154 support-assets.githubassets.com opengraph.githubassets.com github-registry-files.githubusercontent.com github-cloud.githubusercontent.com
Thanks to DeLegacy IPv6 RPZ some of above addresses are now served from official GitHub IPv6 addresses, which aren’t published in their DNS zone yet.
Once added, you can clone as usual, without any changes: git clone https://github.com/DanWin/le-chat-php
All of this is done with the following nginx configuration on a dual stack server:
stream {
server {
listen [2a01:4f8:c010:d56::2]:22 fastopen=100 ipv6only=on;
proxy_pass github.com:22;
}
server {
listen [2a01:4f8:c010:d56::2]:443 fastopen=100 ipv6only=on;
proxy_pass github.com:443;
}
server {
listen [2a01:4f8:c010:d56::3]:443 fastopen=100 ipv6only=on;
proxy_pass api.github.com:443;
}
server {
listen [2a01:4f8:c010:d56::4]:443 fastopen=100 ipv6only=on;
proxy_pass codeload.github.com:443;
}
server {
listen [2a01:4f8:c010:d56::6]:443 fastopen=100 ipv6only=on;
proxy_pass ghcr.io:443;
}
server {
listen [2a01:4f8:c010:d56::7]:443 fastopen=100 ipv6only=on;
proxy_pass pkg.github.com:443;
}
server {
listen [2a01:4f8:c010:d56::8]:443 fastopen=100 ipv6only=on;
proxy_pass uploads.github.com:443;
}
}
If there are any further questions, contact me.