cmd

package
v0.0.0-...-17a438b Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const ContentSecurityPolicy = "Content-Security-Policy"
View Source
const ReferrerPolicy = "Referrer-Policy"
View Source
const XContentTypeOptions = "X-Content-Type-Options"

Variables

This section is empty.

Functions

func ListenHTTPWithProxy

func ListenHTTPWithProxy(proxyServer Proxy, options Options, errorCh *chan error)

func NewProxyHandler

func NewProxyHandler(toUrl url.URL) *httputil.ReverseProxy

func RootCommand

func RootCommand(errorCh *chan error) *cobra.Command

func RunRoot

func RunRoot(errorCh *chan error)

func ServeCommand

func ServeCommand(proxyServer Proxy, errorCh *chan error) *cobra.Command

func SetContentSecurityPolicyHeader

func SetContentSecurityPolicyHeader(response *http.Response)

func SetReferrerPolicyHeader

func SetReferrerPolicyHeader(response *http.Response)

func SetXContentTypeOptionsHeader

func SetXContentTypeOptionsHeader(response *http.Response)

Types

type Options

type Options interface {
	ListenAddress() string
	ProxyAddressURL() url.URL
}

func NewOptions

func NewOptions(listenAddress string, proxyAddressRaw string) (Options, error)

type Proxy

type Proxy interface {
	ListenAndServe(addr string, handler http.HandlerFunc) error
}

type ServerProxy

type ServerProxy struct {
}

func (*ServerProxy) ListenAndServe

func (s *ServerProxy) ListenAndServe(addr string, handler http.HandlerFunc) error

type TestProxy

type TestProxy struct {
	Addr    string
	Handler http.HandlerFunc
}

func (*TestProxy) ListenAndServe

func (t *TestProxy) ListenAndServe(addr string, handler http.HandlerFunc) error

type TransportLogger

type TransportLogger struct{}

func (TransportLogger) RoundTrip

func (TransportLogger) RoundTrip(req *http.Request) (*http.Response, error)

Jump to

Keyboard shortcuts

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