Documentation ¶
Index ¶
- Constants
- func LoadClientCertificate(config *config.ClientCertificate) (tls.Certificate, tls.Certificate, error)
- func LoadServerCertificate(config *config.ServerCertificate) (tls.Certificate, error)
- func NewTLSProxy(addr, port string, logger logrus.FieldLogger, settings *config.Settings) (*http.Server, error)
- func SortPathPatterns(pathPatterns []string)
- type ErrorWrapper
- type HTTPServer
- type ListenPort
- type Mux
- type PEM
- type Ports
- type SelfSignedCertificate
- type TLSDevPorts
Constants ¶
View Source
const TLSProxyOption = "https_dev_proxy"
Variables ¶
This section is empty.
Functions ¶
func LoadClientCertificate ¶
func LoadClientCertificate(config *config.ClientCertificate) (tls.Certificate, tls.Certificate, error)
func LoadServerCertificate ¶
func LoadServerCertificate(config *config.ServerCertificate) (tls.Certificate, error)
func NewTLSProxy ¶
func SortPathPatterns ¶
func SortPathPatterns(pathPatterns []string)
Types ¶
type ErrorWrapper ¶
type ErrorWrapper struct {
// contains filtered or unexported fields
}
ErrorWrapper logs incoming Write bytes with the context filled logrus.FieldLogger.
type HTTPServer ¶
type HTTPServer struct {
// contains filtered or unexported fields
}
HTTPServer represents a configured HTTP server.
func New ¶
func New(cmdCtx, evalCtx context.Context, log logrus.FieldLogger, settings *config.Settings, timings *runtime.HTTPTimings, p runtime.Port, hosts runtime.Hosts) (*HTTPServer, error)
New creates an HTTP(S) server with configured router and middlewares.
func NewServers ¶
func NewServers(cmdCtx, evalCtx context.Context, log logrus.FieldLogger, settings *config.Settings, timings *runtime.HTTPTimings, srvConf runtime.ServerConfiguration) ([]*HTTPServer, func(), error)
NewServers returns a list of the created and configured HTTP(s) servers.
func (*HTTPServer) Listen ¶
func (s *HTTPServer) Listen() error
Listen initiates the configured http handler and start listing on given port.
func (*HTTPServer) ServeHTTP ¶
func (s *HTTPServer) ServeHTTP(rw http.ResponseWriter, req *http.Request)
type ListenPort ¶
type ListenPort string
func (ListenPort) Port ¶
func (lp ListenPort) Port() runtime.Port
type Mux ¶
type Mux struct {
// contains filtered or unexported fields
}
Mux is a http request router and dispatches requests to their corresponding http handlers.
func NewMux ¶
func NewMux(options *runtime.MuxOptions) *Mux
func (*Mux) RegisterConfigured ¶
func (m *Mux) RegisterConfigured()
type SelfSignedCertificate ¶
type SelfSignedCertificate struct { CA *tls.Certificate CACertificate PEM Server *tls.Certificate ServerCertificate PEM ServerPrivateKey []byte Client *tls.Certificate ClientCertificate PEM ClientPrivateKey []byte ClientIntermediateCertificate PEM ClientIntermediate *tls.Certificate }
func NewCertificate ¶
func NewCertificate(duration time.Duration, hosts []string, notBefore *time.Time) (*SelfSignedCertificate, error)
NewCertificate creates a certificate with given hosts and duration. If no hosts are provided all localhost variants will be used.
type TLSDevPorts ¶
type TLSDevPorts map[ListenPort]Ports
func (TLSDevPorts) Add ¶
func (tdp TLSDevPorts) Add(pair string) error
func (TLSDevPorts) Get ¶
func (tdp TLSDevPorts) Get(p string) []string
Click to show internal directories.
Click to hide internal directories.