proxy

package
v0.0.0-...-90b9050 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Reverse

type Reverse struct {
	// contains filtered or unexported fields
}

Reverse proxy with cookie checks

func NewReverse

func NewReverse(cookieName, realm string, tokens TokenSet, target *url.URL) *Reverse

NewReverse proxy which checks a specific cookie for protection, if the cookie is not present any request will return 401.

If the cookie is present, access to the target is allowed

func (*Reverse) ServeHTTP

func (r *Reverse) ServeHTTP(w http.ResponseWriter, req *http.Request)

ServeHTTP implements net/http Handler

type TokenSet

type TokenSet interface {
	// Contains returns true if the token is still valid
	Contains(string) (bool, error)
}

TokenSet represents the entire set of valid tokens

Jump to

Keyboard shortcuts

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