๐พ Archived View for source.community โบ ckaznocha โบ gemini โบ blob โบ main โบ example_test.go captured on 2024-02-05 at 09:52:17. Gemini links have been rewritten to link to archived content
โฌ ๏ธ Previous capture (2023-01-29)
-=-=-=-=-=-=-
. ,-. ,-. . . ,-. ,-. ,-. ,-. ,-. ,-,-. ,-,-. . . ,-. . |- . . `-. | | | | | | |-' | | | | | | | | | | | | | | | | | `-' `-' `-^ ' `-' `-' :: `-' `-' ' ' ' ' ' ' `-^ ' ' ' `' `-| /| `-'
git clone https://source.community/ckaznocha/gemini.git
View raw contents of /example_test.go (main)
โโโโโฎ 1โ package gemini_test 2โ 3โ import ( 4โ "context" 5โ "fmt" 6โ "log" 7โ 8โ "source.community/ckaznocha/gemini" 9โ ) 10โ 11โ func ExampleServer_ListenAndServeTLS() { 12โ s := &gemini.Server{ 13โ Handler: gemini.HandlerFunc(func(ctx context.Context, w gemini.ResponseWriter, r *gemini.Request) { 14โ fmt.Fprintln(w.Success(ctx, ""), "Hello, TLS!") 15โ }), 16โ } 17โ 18โ // One can use generate_cert.go in crypto/tls to generate cert.pem and key.pem. 19โ log.Printf("About to listen the default port. Go to gemini://127.0.0.1/") 20โ 21โ err := s.ListenAndServeTLS("", "cert.pem", "key.pem") 22โ log.Fatal(err) 23โ } โโโโโฏ
ยท ยท ยท
ยฉ 2024 source.community