Documentation ¶
Overview ¶
Package webconsole xxx
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // DefaultUpgrader specifies the parameters for upgrading an HTTP // connection to a WebSocket connection. DefaultUpgrader = &websocket.Upgrader{ ReadBufferSize: 1024, WriteBufferSize: 1024, } )
Functions ¶
func NewHttpReverseProxy ¶
func NewHttpReverseProxy(target *url.URL, certConfig *config.CertConfig) (*httputil.ReverseProxy, error)
NewHttpReverseProxy create golang library reverse proxy for normal http request
Types ¶
type WebconsoleProxy ¶
type WebconsoleProxy struct { // Backend returns the backend URL which the proxy uses to reverse proxy Backend func(*http.Request) (*url.URL, error) // Certificatio configuration for backend console proxy CertConfig *config.CertConfig }
WebconsoleProxy mesos web console proxy implementation for mesos-driver
func NewWebconsoleProxy ¶
func NewWebconsoleProxy(port uint, certConfig *config.CertConfig) *WebconsoleProxy
NewWebconsoleProxy create proxy instance for mesos-driver
func (*WebconsoleProxy) ServeHTTP ¶
func (w *WebconsoleProxy) ServeHTTP(rw http.ResponseWriter, req *http.Request)
ServeHTTP original http interface implementation
type WebsocketProxy ¶
type WebsocketProxy struct { // Director, if non-nil, is a function that may copy additional request // headers from the incoming WebSocket connection into the output headers // which will be forwarded to another server. Director func(incoming *http.Request, out http.Header) BackendUrl *url.URL // Upgrader specifies the parameters for upgrading a incoming HTTP // connection to a WebSocket connection. If nil, DefaultUpgrader is used. Upgrader *websocket.Upgrader // Dialer contains options for connecting to the backend WebSocket server. // If nil, DefaultDialer is used. Dialer *websocket.Dialer }
WebsocketProxy is an HTTP Handler that takes an incoming WebSocket connection and proxies it to another server.
func NewWebsocketProxy ¶
func NewWebsocketProxy(certConfig *config.CertConfig, backendUrl *url.URL) *WebsocketProxy
NewWebsocketProxy returns a new Websocket reverse proxy that rewrites the URL's to the scheme, host and base path provider in target.
func (*WebsocketProxy) ServeHTTP ¶
func (w *WebsocketProxy) ServeHTTP(rw http.ResponseWriter, req *http.Request)
ServeHTTP implements the http.Handler that proxies WebSocket connections.
Click to show internal directories.
Click to hide internal directories.