Documentation ¶
Overview ¶
Package wsproxy provides facility for proxying WebSocket connections to GRPC Gateway handlers.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // Expect first message to contain OAuth token. // Provided token will be forwarder to handler in Authorization header. ReadToken bool // Rewrite GET method used in websocket connection to provided value. // Ignored if empty. RewriteMethod string }
Config contains parameters for WebSocketProxy
type WebSocketProxy ¶
type WebSocketProxy struct {
// contains filtered or unexported fields
}
WebSocketProxy adds websocket capability to JSON Streaming HTTP/2 services
func New ¶
func New(c Config, h http.Handler) *WebSocketProxy
New creates instance of WebSocketProxy wrapping given http.Handler Wrapped handler will proxy underlying request through websocket. If upgrade to websocket is not requested handler will be invoked directly.
func (*WebSocketProxy) ServeHTTP ¶
func (wp *WebSocketProxy) ServeHTTP(w http.ResponseWriter, r *http.Request)
Click to show internal directories.
Click to hide internal directories.