diff options
| author | Leonardo Bishop <me@leonardobishop.com> | 2025-02-06 15:22:34 +0000 |
|---|---|---|
| committer | Leonardo Bishop <me@leonardobishop.com> | 2025-02-06 15:22:34 +0000 |
| commit | 2475f5a8b92ef0dd28e7af5f36d01b25243ed778 (patch) | |
| tree | 12f8931d241db4159f8d30f7bf2b648709a94166 /web | |
Initial commit
Diffstat (limited to 'web')
| -rw-r--r-- | web/index.html | 59 | ||||
| -rw-r--r-- | web/web.go | 13 |
2 files changed, 72 insertions, 0 deletions
diff --git a/web/index.html b/web/index.html new file mode 100644 index 0000000..cdb46ed --- /dev/null +++ b/web/index.html @@ -0,0 +1,59 @@ +<!DOCTYPE html> +<html> + +<head> + <title>{{.Host}} tunneling service</title> + + <style> + dt { + font-weight: bold; + } + + dd { + margin-bottom: 1em; + } + </style> +</head> + +<body> + <h1>{{.Host}} tunneling service</h1> + <p> + This service uses WireGuard to expose your local server to the Internet. + (No custom client needed!) + </p> + + <h2>Usage</h2> + + <p> + In your terminal: + </p> + + <pre> +curl -sSL http://{{.Host}}/[PORT YOU WANT TO FORWARD] | sh + </pre> + + <p> + For example, to forward port 8080: + </p> + + <pre> +curl -sSL http://{{.Host}}/8080 | sh + </pre> + + <p> + You will receive a URL that you can use to access your server from anywhere. + </p> + + <h2>Policy</h2> + + <dl> + <dt>Interface name: {{.Iface}}</dt> + <dd>The automated set up script will overwrite any existing interface with this name with its own.</dd> + + <dt>Inactivity time: {{.ExpireAfter}} seconds</dt> + <dd>Tunnels will expire after this amount of time. (You will need to re-create a new one.)</dd> + </dl> + +</body> + +</html>
\ No newline at end of file diff --git a/web/web.go b/web/web.go new file mode 100644 index 0000000..eb955fe --- /dev/null +++ b/web/web.go @@ -0,0 +1,13 @@ +package web + +import ( + "embed" + "html/template" +) + +//go:embed * +var files embed.FS + +func Index() *template.Template { + return template.Must(template.ParseFS(files, "index.html")) +} |
