Back to godoc.org
github.com/sacOO7/GoWebsocket

Package gowebsocket

v0.0.0-...-1436bb9
Latest Go to latest

The latest major version is .

Published: Jul 19, 2018 | License: Apache-2.0 | Module: github.com/sacOO7/GoWebsocket

Index

func BuildProxy

func BuildProxy(Url string) func(*http.Request) (*url.URL, error)

type ConnectionOptions

type ConnectionOptions struct {
	UseCompression bool
	UseSSL         bool
	Proxy          func(*http.Request) (*url.URL, error)
	Subprotocols   []string
}

type Empty

type Empty struct {
}

type ReconnectionOptions

type ReconnectionOptions struct {
}

todo Yet to be done

type Socket

type Socket struct {
	Conn              *websocket.Conn
	WebsocketDialer   *websocket.Dialer
	Url               string
	ConnectionOptions ConnectionOptions
	RequestHeader     http.Header
	OnConnected       func(socket Socket)
	OnTextMessage     func(message string, socket Socket)
	OnBinaryMessage   func(data []byte, socket Socket)
	OnConnectError    func(err error, socket Socket)
	OnDisconnected    func(err error, socket Socket)
	OnPingReceived    func(data string, socket Socket)
	OnPongReceived    func(data string, socket Socket)
	IsConnected       bool
	// contains filtered or unexported fields
}

func New

func New(url string) Socket

func (*Socket) Close

func (socket *Socket) Close()

func (*Socket) Connect

func (socket *Socket) Connect()

func (Socket) EnableLogging

func (socket Socket) EnableLogging()

func (Socket) GetLogger

func (socket Socket) GetLogger() logging.Logger

func (*Socket) SendBinary

func (socket *Socket) SendBinary(data []byte)

func (*Socket) SendText

func (socket *Socket) SendText(message string)

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier