examples: Tweak client and server timeouts
This commit is contained in:
parent
22d57dfc9e
commit
c3fc9a4e9f
|
@ -30,7 +30,7 @@ var (
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
client.Timeout = 2 * time.Minute
|
client.Timeout = 30 * time.Second
|
||||||
client.KnownHosts.LoadDefault()
|
client.KnownHosts.LoadDefault()
|
||||||
client.TrustCertificate = func(hostname string, cert *x509.Certificate) gemini.Trust {
|
client.TrustCertificate = func(hostname string, cert *x509.Certificate) gemini.Trust {
|
||||||
fmt.Printf(trustPrompt, hostname, gemini.Fingerprint(cert))
|
fmt.Printf(trustPrompt, hostname, gemini.Fingerprint(cert))
|
||||||
|
|
|
@ -12,8 +12,8 @@ import (
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
var server gemini.Server
|
var server gemini.Server
|
||||||
server.ReadTimeout = 1 * time.Minute
|
server.ReadTimeout = 30 * time.Second
|
||||||
server.WriteTimeout = 2 * time.Minute
|
server.WriteTimeout = 1 * time.Minute
|
||||||
if err := server.Certificates.Load("/var/lib/gemini/certs"); err != nil {
|
if err := server.Certificates.Load("/var/lib/gemini/certs"); err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user