Update SharedSecret, IPv6Prefix, and Interface to match your server. The remaining tuning constants have sensible defaults and typically don't need changes.
const ( SharedSecret = "your-shared-secret-here" // Secret between client & server Version = "3.1" // Version of the script IPv6Prefix = "xxxx:xxxx:xxxx" // Your /48 prefix IPv6Subnet = "6000" // Subnet within your /48 Interface = "ens3" // Network interface ListenPort = 80 // Proxy server port ListenHost = "0.0.0.0" // Listen on all interfaces Debug = false // Enable debug output)
Build the application:
cd /opt/i6.sharksudo go build -o i6shark ./src
Create the systemd service:
sudo tee /etc/systemd/system/i6shark.service >/dev/null <<'EOF'[Unit]Description=i6.shark IPv6 proxyAfter=network-online.targetWants=network-online.target[Service]WorkingDirectory=/opt/i6.sharkExecStart=/opt/i6.shark/i6sharkRestart=alwaysRestartSec=3User=rootAmbientCapabilities=CAP_NET_BIND_SERVICE CAP_NET_ADMIN[Install]WantedBy=multi-user.targetEOF
API tokens are generated using HMAC-SHA256 with a shared secret key. The input for key generation is the user-agent header. See the validateAPIToken function in the source code for implementation details.