https

package
v0.0.14 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 8, 2019 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RedirectHandler

func RedirectHandler(h http.Handler) http.Handler

RedirectHandler takes an http.Handler and returns a secured form of it.

func Serve

func Serve(handler http.Handler, cfg Config, opts ...func(*http.Server)) error

Serve starts an HTTP server configured to handle traffic directly from an ELB on port and terminate TLS using serverCert and serverKey.

Types

type Config

type Config struct {
	InsecurePort int `env:"HEROKU_ROUTER_HTTP_PORT,required"`
	SecurePort   int `env:"HEROKU_ROUTER_HTTPS_PORT,required"`

	// These environement variables are automatically set by ACM in
	// relation to Let's Encrypt certificates.
	ServerCert  string `env:"SERVER_CERT,required"`
	ServerKey   string `env:"SERVER_KEY,required"`
	UseAutocert bool   `env:"HTTPS_USE_AUTOCERT"`
}

Config for HTTP and HTTPS servers.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL