]> Sergey Matveev's repositories - tofuproxy.git/blobdiff - httpauth.go
Various refactoring
[tofuproxy.git] / httpauth.go
index 548209eff57d93021643b32efda0eadc6b47c35d..5b454cacb64d495d8bc49c1d1924f9ef4d45e250 100644 (file)
@@ -1,5 +1,6 @@
 /*
-tofuproxy -- HTTP proxy with TLS certificates management
+tofuproxy -- flexible HTTP/HTTPS proxy, TLS terminator, X.509 TOFU
+             manager, WARC/geminispace browser
 Copyright (C) 2021 Sergey Matveev <stargrave@stargrave.org>
 
 This program is free software: you can redistribute it and/or modify
@@ -27,6 +28,8 @@ import (
        "os/exec"
        "path/filepath"
        "strings"
+
+       ttls "go.stargrave.org/tofuproxy/tls"
 )
 
 func findInNetrc(host string) (string, string) {
@@ -75,17 +78,22 @@ set passinit "%s"
 set p [entry .pass -show "*" -textvariable passinit]
 grid .lpass .pass
 
-proc submit {} {
+proc login {} {
     global u p
     puts [$u get]
     puts [$p get]
     exit
 }
 
-button .submit -text "Submit" -command submit
-grid .submit
+button .login -text "Login" -command login
+grid .login
+
+bind . <KeyPress> {switch -exact %%K {
+    q {exit 0} ; # reject once
+    l login
+}}
 `, realm, userInit, passInit))
-       cmd := exec.Command(CmdWish)
+       cmd := exec.Command(ttls.CmdWish)
        cmd.Stdin = &b
        out, err := cmd.Output()
        if err != nil {