💾 Archived View for code.pfad.fr › pages captured on 2023-12-28 at 15:26:49. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2023-11-04)

➡️ Next capture (2024-03-21)

🚧 View Differences

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

pages package - code.pfad.fr/pages

import "code.pfad.fr/pages"

Functions

func ComputeHash

func ComputeHash(cleartext string) ([]byte, error)

func CustomizedNotFoundFile

func CustomizedNotFoundFile(fsys fs.FS, notFoundName string) http.Handler

CustomizedNotFoundFile check if a {name}.redirect file is present and redirects there.

func HashChecker

func HashChecker(hash string) (func(cleartext string) error, error)

func HideDirWithoutIndex

func HideDirWithoutIndex(fs fs.FS, indexName string) fs.FS

indexName is usually "index.html"

func HijackNotFoundResponse

func HijackNotFoundResponse(w http.ResponseWriter, notFoundResponse func(w http.ResponseWriter)) http.ResponseWriter

func RedirectHandler

func RedirectHandler(newHost string) http.Handler

func ServerHeader

func ServerHeader() string

func ToPunyCode

func ToPunyCode(hostname string) (string, error)

Types

type Server

type Server struct {
	GetCertificate func(*tls.ClientHelloInfo) (*tls.Certificate, error)

	HttpHandlers   map[string]http.Handler   // the keys must be punycode encoded, see [ToPunyCode]
	GeminiHandlers map[string]gemini.Handler // the keys must be punycode encoded, see [ToPunyCode]
}

func NewServer

func NewServer(httpHandlers map[string]http.Handler, geminiHandlers map[string]gemini.Handler) (*Server, error)

func (*Server) Serve

func (s *Server) Serve(httpLn net.Listener, geminiLn net.Listener, http3Conn net.PacketConn) error

Files

auth.go

fs.go

not_found.go

redirect.go

server.go

tools.go

Directories

cmd/http-redirect

cmd/http3get6

cmd/keygen

cmd/map64

cmd/pages

packetconn

Forge

https://codeberg.org/pfad.fr/pages

git clone

https://codeberg.org/pfad.fr/pages.git
git@codeberg.org:pfad.fr/pages.git