/*
-tofuproxy -- HTTP proxy with TLS certificates management
+tofuproxy -- flexible HTTP/WARC proxy with TLS certificates management
Copyright (C) 2021 Sergey Matveev <stargrave@stargrave.org>
This program is free software: you can redistribute it and/or modify
var b bytes.Buffer
userInit, passInit := findInNetrc(host)
b.WriteString(fmt.Sprintf(`
+tk_setPalette grey
wm title . "Unauthorized: %s"
label .luser -text "User"
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.Stdin = &b