grpc

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: May 14, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DialTimeout     = 5 * time.Second
	ConnectTimeout  = 5 * time.Second
	BackoffMaxDelay = 3 * time.Second

	InitialWindowSize     = 1 << 30
	InitialConnWindowSize = 1 << 30

	KeepAliveTimeout = time.Duration(3) * time.Second
	KeepAliveTime    = time.Duration(10) * time.Second

	MaxRecvMsgSize = 1 << 30
	MaxSendMsgSize = 1 << 30

	ReadBufferSize  = 1 << 10
	WriteBufferSize = 1 << 10

	MaxIdle              = 8
	MaxActive            = 64
	MaxConcurrentStreams = 64
)

Variables

This section is empty.

Functions

func NewClientReadWriter

func NewClientReadWriter(conn pool.Conn, c proto.Tunnel_OnConnectClient) *clientReadWriter

func NewServerReadWriter

func NewServerReadWriter(c proto.Tunnel_OnConnectServer) *serverReadWriter

func VerifyTokenFromContext

func VerifyTokenFromContext(ctx context.Context, token string) error

Types

type Client

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

func NewClient

func NewClient(tunnel string, password string) (*Client, error)

func (*Client) Connect

func (t *Client) Connect(ctx context.Context) (io.ReadWriteCloser, error)

type Server

type Server struct {
	proto.UnimplementedTunnelServer
	// contains filtered or unexported fields
}

func NewServer

func NewServer(tunnel string, password string) (*Server, error)

func (*Server) ListenAndServe added in v0.1.7

func (s *Server) ListenAndServe(handler func(io.ReadWriter)) error

func (*Server) ListenAndServeTLS

func (s *Server) ListenAndServeTLS(certFile, keyFile string, handler func(io.ReadWriter)) error

func (*Server) OnConnect

func (s *Server) OnConnect(stream proto.Tunnel_OnConnectServer) error

Jump to

Keyboard shortcuts

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