wsproxy

package module
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2016 License: MIT Imports: 7 Imported by: 0

README

go-wsproxy

GRPC Gateway WebSocket Proxy

godoc license build coverage

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)

Jump to

Keyboard shortcuts

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