wsconn

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: May 28, 2026 License: Apache-2.0 Imports: 18 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DialCustomWS

func DialCustomWS(addr string, dialer *websocket.Dialer) (net.Conn, error)

func DialWS

func DialWS(addr string) (net.Conn, error)

func H2Client added in v0.0.5

func H2Client(addr string, conn net.Conn, host string) (net.Conn, error)

func WSClient

func WSClient(addr string, conn net.Conn, readBufSize, writeBufSize int) (net.Conn, error)

func WSClientWithHost added in v0.0.6

func WSClientWithHost(addr string, conn net.Conn, host string, readBufSize, writeBufSize int) (net.Conn, error)

func WSServe

func WSServe(addr string, backlog int, innerListener net.Listener, readBufSize, writeBufSize int) (net.Listener, error)

when "innerListener" is set to null, will start listening on address defined in "addr"

Types

type Conn

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

func WrapConn

func WrapConn(conn *websocket.Conn) *Conn

func (*Conn) Close

func (c *Conn) Close() error

func (*Conn) CloseChan

func (c *Conn) CloseChan() <-chan struct{}

func (*Conn) LocalAddr

func (c *Conn) LocalAddr() net.Addr

func (*Conn) Read

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

func (*Conn) RemoteAddr

func (c *Conn) RemoteAddr() net.Addr

func (*Conn) SetDeadline

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

func (*Conn) SetReadDeadline

func (c *Conn) SetReadDeadline(t time.Time) error

func (*Conn) SetWriteDeadline

func (c *Conn) SetWriteDeadline(t time.Time) error

func (*Conn) Write

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

type HttpHandler

type HttpHandler func(response http.ResponseWriter, request *http.Request)

func (HttpHandler) ServeHTTP

func (h HttpHandler) ServeHTTP(response http.ResponseWriter, request *http.Request)

type Listener

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

func (*Listener) Accept

func (l *Listener) Accept() (net.Conn, error)

func (*Listener) Addr

func (l *Listener) Addr() net.Addr

func (*Listener) Close

func (l *Listener) Close() error

type RawConn added in v0.0.5

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

func WrapRawConn added in v0.0.5

func WrapRawConn(conn net.Conn, isClient bool) *RawConn

func (*RawConn) Close added in v0.0.5

func (c *RawConn) Close() error

func (*RawConn) LocalAddr added in v0.0.5

func (c *RawConn) LocalAddr() net.Addr

func (*RawConn) Read added in v0.0.5

func (c *RawConn) Read(b []byte) (int, error)

func (*RawConn) RemoteAddr added in v0.0.5

func (c *RawConn) RemoteAddr() net.Addr

func (*RawConn) SetDeadline added in v0.0.5

func (c *RawConn) SetDeadline(t time.Time) error

func (*RawConn) SetReadDeadline added in v0.0.5

func (c *RawConn) SetReadDeadline(t time.Time) error

func (*RawConn) SetWriteDeadline added in v0.0.5

func (c *RawConn) SetWriteDeadline(t time.Time) error

func (*RawConn) Write added in v0.0.5

func (c *RawConn) Write(b []byte) (int, error)

Jump to

Keyboard shortcuts

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