Package http2https provides tools to redirect from HTTP to HTTPS, for the Go programming language.
Find a file
2025-11-03 08:21:46 -08:00
discard.go source-code 2025-06-15 08:00:48 -07:00
go.mod codeberg 2025-11-03 08:21:46 -08:00
go.sum go.* 2025-06-15 07:55:21 -07:00
handler.go source-code 2025-06-15 08:00:48 -07:00
httphandler.go source-code 2025-06-15 08:00:48 -07:00
LICENSE initial commits 2025-06-15 07:54:16 -07:00
README.md codeberg 2025-11-03 08:21:46 -08:00

go-http2https

Package http2https provides tools to redirect from HTTP to HTTPS, for the Go programming language.

Documention

Online documentation, which includes examples, can be found at: http://godoc.org/codeberg.org/reiver/go-http2https

GoDoc

Examples

Here is a simple example:

import "codeberg.org/reiver/go-http2https"

// ...

err := http.ListenAndServe(tcpaddr, http2https.Handler)

Here is an example that provide the http2https http.Hanlder with a function to call to log errors:

import "codeberg.org/reiver/go-http2https"

// ...

func logError(a ...any) {
	fmt.Println(a...)
}

// ...

var handler http.Handler = http2https.HTTPHandler{
	LogError: logError,
}

err := http.ListenAndServe(tcpaddr, handler)

Import

To import package http2https use import code like the following:

import "codeberg.org/reiver/go-http2https"

Installation

To install package http2https do the following:

GOPROXY=direct go get codeberg.org/reiver/go-http2https

Author

Package http2https was written by Charles Iliya Krempeaux