ws

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

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

Go to latest
Published: May 3, 2018 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHandler

func NewHandler(opts *fwd.Options, dialer gnatsdgw.Dialer, upgrader *websocket.Upgrader, mimConnector gnatsdgw.Connector) (http.Handler, error)

NewHandler creates new forwarder to handle websocket connections

Types

type Conn

type Conn struct {
	*websocket.Conn

	// addition info from request
	Request struct {
		Header     http.Header
		Method     string
		URL        *url.URL
		Host       string
		RemoteAddr string
		RequestURI string
	}
	// contains filtered or unexported fields
}

Conn wrapps upgraded *websocket.Conn with addition request info.

func (*Conn) Read

func (wsc *Conn) Read(b []byte) (n int, err error)

func (*Conn) RemoteAddrString

func (wsc *Conn) RemoteAddrString() string

RemoteAddrString returns string in request

func (*Conn) SetDeadline

func (wsc *Conn) SetDeadline(t time.Time) error

SetDeadline implements the net.Conn

func (*Conn) Write

func (wsc *Conn) Write(b []byte) (n int, err error)

Jump to

Keyboard shortcuts

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