update: notify user when accessing an unknown tunnel address

This commit is contained in:
2025-02-08 18:34:45 +07:00
parent af6c6ba8a6
commit 58f15d5a67
4 changed files with 4 additions and 0 deletions

1
go.mod
View File

@ -10,6 +10,7 @@ require (
)
require (
github.com/google/uuid v1.6.0 // indirect
golang.org/x/sys v0.29.0 // indirect
golang.org/x/text v0.21.0 // indirect
)

2
go.sum
View File

@ -2,6 +2,8 @@ github.com/a-h/templ v0.3.833 h1:L/KOk/0VvVTBegtE0fp2RJQiBm7/52Zxv5fqlEHiQUU=
github.com/a-h/templ v0.3.833/go.mod h1:cAu4AiZhtJfBjMY0HASlyzvkrtjnHWPeEsyGK2YYmfk=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0=
github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4=
golang.org/x/crypto v0.32.0 h1:euUpcYgM8WcP71gNpTqQCn6rC2t6ULUPiOzfWaXVVfc=

View File

@ -51,6 +51,7 @@ func handleRequestTLS(w http.ResponseWriter, r *http.Request) {
sshSession, ok := session.Clients[slug]
if !ok {
fmt.Println("Error finding ssh session: ", slug)
http.Error(w, "No tunnel found on this address", http.StatusNotFound)
return
}

BIN
main

Binary file not shown.