grpc

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2022 License: MIT Imports: 17 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, key []byte) 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 JwtToken

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

func (*JwtToken) GetRequestMetadata

func (t *JwtToken) GetRequestMetadata(ctx context.Context, uri ...string) (map[string]string, error)

func (*JwtToken) RequireTransportSecurity

func (t *JwtToken) RequireTransportSecurity() bool

type Server

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

func NewServer

func NewServer(tunnel string, password string) (*Server, 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