๐Ÿ’พ Archived View for source.community โ€บ ckaznocha โ€บ gemini โ€บ blob โ€บ main โ€บ example_test.go captured on 2023-07-10 at 13:28:54. Gemini links have been rewritten to link to archived content

View Raw

More Information

โฌ…๏ธ Previous capture (2023-01-29)

โžก๏ธ Next capture (2024-02-05)

-=-=-=-=-=-=-

                                                         .
,-. ,-. . . ,-. ,-. ,-.    ,-. ,-. ,-,-. ,-,-. . . ,-. . |- . .
`-. | | | | |   |   |-'    |   | | | | | | | | | | | | | |  | |
`-' `-' `-^ '   `-' `-' :: `-' `-' ' ' ' ' ' ' `-^ ' ' ' `' `-|
                                                             /|
                                                            `-'

Profile for ckaznocha

ckaznocha / gemini

git clone https://source.community/ckaznocha/gemini.git

Branches

Log

Tree

/example_test.go (main)

โ†‘ /

blob

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โ”‚ }
โ”€โ”€โ”€โ”€โ•ฏ

ยท ยท ยท

๐Ÿก Home

FAQs

Privacy Policy

Terms & Conditions

Official Gemlog

info@source.community

ยฉ 2023 source.community