package gemini_test import ( "context" "fmt" "log" "source.community/ckaznocha/gemini" ) func ExampleServer_ListenAndServeTLS() { s := &gemini.Server{ Handler: gemini.HandlerFunc(func(ctx context.Context, w gemini.ResponseWriter, r *gemini.Request) { fmt.Fprintln(w.Success(ctx, ""), "Hello, TLS!") }), } // One can use generate_cert.go in crypto/tls to generate cert.pem and key.pem. log.Printf("About to listen the default port. Go to gemini://127.0.0.1/") err := s.ListenAndServeTLS("", "cert.pem", "key.pem") log.Fatal(err) }