~adnano/go-gemini

353416685a780c5ef50e3e69f87dcd68e4aec529 — Adnan Maolood 9 months ago 0ceec22
doc: Fix Mux documentation
1 files changed, 3 insertions(+), 3 deletions(-)

M doc.go
M doc.go => doc.go +3 -3
@@ 30,7 30,7 @@ Servers should be configured with certificates:
	server.GetCertificate = certificates.Get

Mux is a Gemini request multiplexer.
Mux can handle requests for multiple hosts and schemes.
Mux can handle requests for multiple hosts and paths.

	mux := &gemini.Mux{}
	mux.HandleFunc("example.com", func(ctx context.Context, w gemini.ResponseWriter, r *gemini.Request) {


@@ 39,8 39,8 @@ Mux can handle requests for multiple hosts and schemes.
	mux.HandleFunc("example.org/about.gmi", func(ctx context.Context, w gemini.ResponseWriter, r *gemini.Request) {
		fmt.Fprint(w, "About example.org")
	})
	mux.HandleFunc("http://example.net", func(ctx context.Context, w gemini.ResponseWriter, r *gemini.Request) {
		fmt.Fprint(w, "Proxied content from http://example.net")
	mux.HandleFunc("/images/", func(ctx context.Context, w gemini.ResponseWriter, r *gemini.Request) {
		w.WriteHeader(gemini.StatusGone, "Gone forever")
	})
	server.Handler = mux