v2raygrpc

package
v1.7.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2023 License: GPL-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_transport_v2raygrpc_stream_proto protoreflect.FileDescriptor
View Source
var GunService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "transport.v2raygrpc.GunService",
	HandlerType: (*GunServiceServer)(nil),
	Methods:     []grpc.MethodDesc{},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "Tun",
			Handler:       _GunService_Tun_Handler,
			ServerStreams: true,
			ClientStreams: true,
		},
	},
	Metadata: "transport/v2raygrpc/stream.proto",
}

GunService_ServiceDesc is the grpc.ServiceDesc for GunService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func NewClient

func NewClient(ctx context.Context, dialer N.Dialer, serverAddr M.Socksaddr, options option.V2RayGRPCOptions, tlsConfig tls.Config) (adapter.V2RayClientTransport, error)

func NewTLSTransportCredentials added in v1.1.0

func NewTLSTransportCredentials(config tls.Config) credentials.TransportCredentials

func RegisterGunServiceCustomNameServer

func RegisterGunServiceCustomNameServer(s *grpc.Server, srv GunServiceServer, name string)

func RegisterGunServiceServer

func RegisterGunServiceServer(s grpc.ServiceRegistrar, srv GunServiceServer)

func ServerDesc

func ServerDesc(name string) grpc.ServiceDesc

Types

type Client

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

func (*Client) Close

func (c *Client) Close() error

func (*Client) DialContext

func (c *Client) DialContext(ctx context.Context) (net.Conn, error)

type GRPCConn

type GRPCConn struct {
	GunService
	// contains filtered or unexported fields
}

func NewGRPCConn

func NewGRPCConn(service GunService, cancel common.ContextCancelCauseFunc) *GRPCConn

func (*GRPCConn) Close

func (c *GRPCConn) Close() error

func (*GRPCConn) LocalAddr

func (c *GRPCConn) LocalAddr() net.Addr

func (*GRPCConn) NeedAdditionalReadDeadline added in v1.2.5

func (c *GRPCConn) NeedAdditionalReadDeadline() bool

func (*GRPCConn) Read

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

func (*GRPCConn) RemoteAddr

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

func (*GRPCConn) SetDeadline

func (c *GRPCConn) SetDeadline(t time.Time) error

func (*GRPCConn) SetReadDeadline

func (c *GRPCConn) SetReadDeadline(t time.Time) error

func (*GRPCConn) SetWriteDeadline

func (c *GRPCConn) SetWriteDeadline(t time.Time) error

func (*GRPCConn) Upstream

func (c *GRPCConn) Upstream() any

func (*GRPCConn) Write

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

type GunService

type GunService interface {
	Context() context.Context
	Send(*Hunk) error
	Recv() (*Hunk, error)
}

type GunServiceClient

type GunServiceClient interface {
	Tun(ctx context.Context, opts ...grpc.CallOption) (GunService_TunClient, error)
}

GunServiceClient is the client API for GunService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

func NewGunServiceClient

func NewGunServiceClient(cc grpc.ClientConnInterface) GunServiceClient

type GunServiceCustomNameClient

type GunServiceCustomNameClient interface {
	TunCustomName(ctx context.Context, name string, opts ...grpc.CallOption) (GunService_TunClient, error)
	Tun(ctx context.Context, opts ...grpc.CallOption) (GunService_TunClient, error)
}

type GunServiceServer

type GunServiceServer interface {
	Tun(GunService_TunServer) error
	// contains filtered or unexported methods
}

GunServiceServer is the server API for GunService service. All implementations must embed UnimplementedGunServiceServer for forward compatibility

type GunService_TunClient

type GunService_TunClient interface {
	Send(*Hunk) error
	Recv() (*Hunk, error)
	grpc.ClientStream
}

type GunService_TunServer

type GunService_TunServer interface {
	Send(*Hunk) error
	Recv() (*Hunk, error)
	grpc.ServerStream
}

type Hunk

type Hunk struct {
	Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
	// contains filtered or unexported fields
}

func (*Hunk) Descriptor deprecated

func (*Hunk) Descriptor() ([]byte, []int)

Deprecated: Use Hunk.ProtoReflect.Descriptor instead.

func (*Hunk) GetData

func (x *Hunk) GetData() []byte

func (*Hunk) ProtoMessage

func (*Hunk) ProtoMessage()

func (*Hunk) ProtoReflect

func (x *Hunk) ProtoReflect() protoreflect.Message

func (*Hunk) Reset

func (x *Hunk) Reset()

func (*Hunk) String

func (x *Hunk) String() string

type Server

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

func NewServer

func NewServer(ctx context.Context, options option.V2RayGRPCOptions, tlsConfig tls.ServerConfig, handler N.TCPConnectionHandler) (*Server, error)

func (*Server) Close

func (s *Server) Close() error

func (*Server) Network

func (s *Server) Network() []string

func (*Server) Serve

func (s *Server) Serve(listener net.Listener) error

func (*Server) ServePacket

func (s *Server) ServePacket(listener net.PacketConn) error

func (*Server) Tun

func (s *Server) Tun(server GunService_TunServer) error

type TLSTransportCredentials added in v1.1.0

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

func (*TLSTransportCredentials) ClientHandshake added in v1.1.0

func (c *TLSTransportCredentials) ClientHandshake(ctx context.Context, authority string, rawConn net.Conn) (net.Conn, credentials.AuthInfo, error)

func (*TLSTransportCredentials) Clone added in v1.1.0

func (*TLSTransportCredentials) Info added in v1.1.0

func (*TLSTransportCredentials) OverrideServerName added in v1.1.0

func (c *TLSTransportCredentials) OverrideServerName(serverNameOverride string) error

func (*TLSTransportCredentials) ServerHandshake added in v1.1.0

func (c *TLSTransportCredentials) ServerHandshake(rawConn net.Conn) (net.Conn, credentials.AuthInfo, error)

type UnimplementedGunServiceServer

type UnimplementedGunServiceServer struct{}

UnimplementedGunServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedGunServiceServer) Tun

type UnsafeGunServiceServer

type UnsafeGunServiceServer interface {
	// contains filtered or unexported methods
}

UnsafeGunServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to GunServiceServer will result in compilation errors.

Directories

Path Synopsis
Package credentials defines APIs for parsing SPIFFE ID.
Package credentials defines APIs for parsing SPIFFE ID.

Jump to

Keyboard shortcuts

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