grpc

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: May 21, 2024 License: MIT Imports: 15 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 NewGrpcClientConn added in v1.0.0

func NewGrpcClientConn(c proto.Tunnel_OnConnectClient, conn *grpc.ClientConn) io.ReadWriteCloser

func NewGrpcServerConn added in v1.0.0

func NewGrpcServerConn(conn proto.Tunnel_OnConnectServer) io.ReadWriteCloser

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(opts util.ToxOptions) (*Client, error)

func (*Client) Connect

func (t *Client) Connect(ctx context.Context) (util.ToxConn, error)

type GrpcClientConn added in v1.0.0

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

func (*GrpcClientConn) Close added in v1.0.0

func (conn *GrpcClientConn) Close() error

func (*GrpcClientConn) Read added in v1.0.0

func (conn *GrpcClientConn) Read(p []byte) (int, error)

func (*GrpcClientConn) Write added in v1.0.0

func (conn *GrpcClientConn) Write(p []byte) (int, error)

type GrpcServerConn added in v1.0.0

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

func (*GrpcServerConn) Close added in v1.0.0

func (conn *GrpcServerConn) Close() error

func (*GrpcServerConn) Read added in v1.0.0

func (conn *GrpcServerConn) Read(p []byte) (int, error)

func (*GrpcServerConn) Write added in v1.0.0

func (conn *GrpcServerConn) Write(p []byte) (int, error)

type Server

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

func NewServer

func NewServer(opts util.ToxOptions) (*Server, error)

func (*Server) ListenAndServe added in v0.1.7

func (s *Server) ListenAndServe(handler func(util.ToxConn)) 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