remotedialer

package
v0.0.0-...-5e5ff2f Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2018 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Data messageType = iota + 1
	Connect
	Error
)

Variables

View Source
var (
	PingWaitDuration  = time.Duration(10 * time.Second)
	PingWriteInterval = time.Duration(5 * time.Second)
	MaxRead           = 8192
)
View Source
var (
	ErrConnClosed = errors.New("ConnClosed")
)

Functions

func ClientConnect

func ClientConnect(wsURL string, headers http.Header, tlsConfig *tls.Config, auth ConnectAuthorizer)

Types

type Authorizer

type Authorizer func(req *http.Request) (clientKey string, authed bool, err error)

type ConnectAuthorizer

type ConnectAuthorizer func(proto, address string) bool

type Dialer

type Dialer func(proto, address string) (net.Conn, error)

type ErrorWriter

type ErrorWriter func(rw http.ResponseWriter, req *http.Request, code int, err error)

type Server

type Server struct {
	// contains filtered or unexported fields
}

func New

func New(auth Authorizer, errorWriter ErrorWriter) *Server

func (*Server) Dial

func (s *Server) Dial(clientKey string, deadline time.Duration, proto, address string) (net.Conn, error)

func (*Server) Dialer

func (s *Server) Dialer(clientKey string, deadline time.Duration) Dialer

func (*Server) ServeHTTP

func (s *Server) ServeHTTP(rw http.ResponseWriter, req *http.Request)

Jump to

Keyboard shortcuts

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