ws

package
v0.6.3 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2018 License: GPL-3.0 Imports: 15 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FrameReader

func FrameReader(r io.Reader) io.Reader

FrameReader returns a chunked reader

func FrameWriter

func FrameWriter(w io.Writer) io.Writer

FrameWriter returns a frame writer

func NewWSDialer

func NewWSDialer(s string, dialer proxy.Dialer) (proxy.Dialer, error)

NewWSDialer returns a ws proxy dialer.

Types

type Client

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

Client ws client

func NewClient

func NewClient(host, path string) (*Client, error)

NewClient .

func (*Client) NewConn

func (c *Client) NewConn(rc net.Conn, target string) (*Conn, error)

NewConn .

type Conn

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

Conn is a connection to ws server

func (*Conn) Handshake

func (c *Conn) Handshake(host, path string) error

Handshake handshakes with the server using HTTP to request a protocol upgrade

func (*Conn) Read

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

func (*Conn) Write

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

type WS

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

WS .

func NewWS

func NewWS(s string, dialer proxy.Dialer) (*WS, error)

NewWS returns a websocket proxy.

func (*WS) Addr

func (s *WS) Addr() string

Addr returns forwarder's address

func (*WS) Dial

func (s *WS) Dial(network, addr string) (net.Conn, error)

Dial connects to the address addr on the network net via the proxy.

func (*WS) DialUDP

func (s *WS) DialUDP(network, addr string) (net.PacketConn, net.Addr, error)

DialUDP connects to the given address via the proxy.

func (*WS) NextDialer

func (s *WS) NextDialer(dstAddr string) proxy.Dialer

NextDialer returns the next dialer

Jump to

Keyboard shortcuts

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