websocket

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: May 13, 2021 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const Name = "WEBSOCKET"

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func NewClient

func NewClient(ctx context.Context, underlay tunnel.Client) (*Client, error)

func (*Client) Close

func (c *Client) Close() error

func (*Client) DialConn

func (c *Client) DialConn(_ *tunnel.Address, user statistic.User, metadata *tunnel.Metadata, _ tunnel.Tunnel) (tunnel.Conn, error)

func (*Client) DialPacket

func (c *Client) DialPacket(statistic.User, tunnel.Tunnel) (tunnel.PacketConn, error)

type Config

type Config struct {
	RemoteHost string          `json:"remote_addr" yaml:"remote-addr"`
	RemotePort int             `json:"remote_port" yaml:"remote-port"`
	Websocket  WebsocketConfig `json:"websocket" yaml:"websocket"`
}

type InboundConn

type InboundConn struct {
	OutboundConn
	// contains filtered or unexported fields
}

func (*InboundConn) Close

func (c *InboundConn) Close() error

func (*InboundConn) Epoch

func (c *InboundConn) Epoch() time.Time

func (*InboundConn) Recv

func (c *InboundConn) Recv() uint64

func (*InboundConn) Sent

func (c *InboundConn) Sent() uint64

type OutboundConn

type OutboundConn struct {
	*websocket.Conn
	// contains filtered or unexported fields
}

func (*OutboundConn) Epoch

func (c *OutboundConn) Epoch() time.Time

func (*OutboundConn) Metadata

func (c *OutboundConn) Metadata() *tunnel.Metadata

func (*OutboundConn) Name

func (c *OutboundConn) Name() string

func (*OutboundConn) Recv

func (c *OutboundConn) Recv() uint64

func (*OutboundConn) RemoteAddr

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

func (*OutboundConn) Sent

func (c *OutboundConn) Sent() uint64

func (*OutboundConn) Tunnels

func (c *OutboundConn) Tunnels() *tunnel.Tunnels

func (*OutboundConn) User

func (c *OutboundConn) User() statistic.User

type Server

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

func NewServer

func NewServer(ctx context.Context, underlay tunnel.Server) (*Server, error)

func (*Server) AcceptConn

func (s *Server) AcceptConn(tunnel.Tunnel) (tunnel.Conn, error)

func (*Server) AcceptPacket

func (s *Server) AcceptPacket(tunnel.Tunnel) (tunnel.PacketConn, error)

func (*Server) Close

func (s *Server) Close() error

type Tunnel

type Tunnel struct{}

func (*Tunnel) Name

func (*Tunnel) Name() string

func (*Tunnel) NewClient

func (*Tunnel) NewClient(ctx context.Context, underlay tunnel.Client) (tunnel.Client, error)

func (*Tunnel) NewServer

func (*Tunnel) NewServer(ctx context.Context, underlay tunnel.Server) (tunnel.Server, error)

type WebsocketConfig

type WebsocketConfig struct {
	Enabled bool   `json:"enabled" yaml:"enabled"`
	Host    string `json:"host" yaml:"host"`
	Path    string `json:"path" yaml:"path"`
}

Jump to

Keyboard shortcuts

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