GoWebsocket: github.com/sacOO7/GoWebsocket Index | Files

package gowebsocket

import "github.com/sacOO7/GoWebsocket"


Package Files

gowebsocket.go utils.go

func BuildProxy Uses

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

type ConnectionOptions Uses

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

type Empty Uses

type Empty struct {

type ReconnectionOptions Uses

type ReconnectionOptions struct {

todo Yet to be done

type Socket Uses

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
    Timeout           time.Duration
    // contains filtered or unexported fields

func New Uses

func New(url string) Socket

func (*Socket) Close Uses

func (socket *Socket) Close()

func (*Socket) Connect Uses

func (socket *Socket) Connect()

func (Socket) EnableLogging Uses

func (socket Socket) EnableLogging()

func (Socket) GetLogger Uses

func (socket Socket) GetLogger() logging.Logger

func (*Socket) SendBinary Uses

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

func (*Socket) SendText Uses

func (socket *Socket) SendText(message string)

Package gowebsocket imports 10 packages (graph). Updated 2020-11-01. Refresh now. Tools for package owners.