Documentation ¶
Overview ¶
Package grpcHardcore implements grpc tunnel without importing google.golang.org/grpc.
Reference ¶
https://github.com/Dreamacro/clash/blob/master/transport/gun/gun.go, which is under MIT license
在 clash的客户端实现 的 基础上 继续用 golang的 http2包 实现了 grpc 的 基本服务端,并改进了 原代码。
grpcSimple包 比grpc包 小很多,替代grpc包的话,可以减小 4MB 左右的可执行文件大小。但是目前不支持 multiMode。
grpcSimple包 是很棒 很有用的 实现,未来可以添加 针对 grpc的ServiceName的回落。
Index ¶
- Variables
- type Client
- type ClientConn
- func (g *ClientConn) Close() error
- func (g *ClientConn) LocalAddr() net.Addr
- func (g *ClientConn) Read(b []byte) (n int, err error)
- func (g *ClientConn) RemoteAddr() net.Addr
- func (g *ClientConn) SetDeadline(t time.Time) error
- func (g *ClientConn) SetReadDeadline(t time.Time) error
- func (g *ClientConn) SetWriteDeadline(t time.Time) error
- func (g *ClientConn) Write(b []byte) (n int, err error)
- type Config
- type Creator
- type Server
- type ServerConn
- func (g *ServerConn) Close() error
- func (g *ServerConn) LocalAddr() net.Addr
- func (g *ServerConn) Read(b []byte) (n int, err error)
- func (g *ServerConn) RemoteAddr() net.Addr
- func (g *ServerConn) SetDeadline(t time.Time) error
- func (g *ServerConn) SetReadDeadline(t time.Time) error
- func (g *ServerConn) SetWriteDeadline(t time.Time) error
- func (g *ServerConn) Write(b []byte) (n int, err error)
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrInvalidLength = errors.New("invalid length")
)
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { Config // contains filtered or unexported fields }
func (*Client) GetCommonConn ¶
由于 本包应用了 http2包, 无法获取特定连接, 所以返回 underlay 本身
func (*Client) ProcessWhenFull ¶
type ClientConn ¶
type ClientConn struct {
// contains filtered or unexported fields
}
implements net.Conn
func (*ClientConn) Close ¶
func (g *ClientConn) Close() error
func (*ClientConn) RemoteAddr ¶
func (*ClientConn) SetDeadline ¶
func (*ClientConn) SetReadDeadline ¶
func (*ClientConn) SetWriteDeadline ¶
type Creator ¶
type Creator struct{}
func (Creator) GetDefaultAlpn ¶
func (Creator) NewClientFromConf ¶
func (Creator) NewServerFromConf ¶
type ServerConn ¶
func (*ServerConn) Close ¶
func (g *ServerConn) Close() error
func (*ServerConn) RemoteAddr ¶
func (*ServerConn) SetDeadline ¶
func (*ServerConn) SetReadDeadline ¶
func (*ServerConn) SetWriteDeadline ¶
Click to show internal directories.
Click to hide internal directories.