Documentation
¶
Index ¶
- Variables
- func WithProxy(p proxy.Proxy) func(*Shunt)
- type MODE
- type Shunt
- type Statistic
- func (c *Statistic) AddClient(f func(*statistic.RateResp) error) (id int64)
- func (c *Statistic) AddDownload(n uint64)
- func (c *Statistic) AddUpload(n uint64)
- func (c *Statistic) CloseConn(_ context.Context, x *statistic.CloseConnsReq) (*emptypb.Empty, error)
- func (c *Statistic) Conn(host string) (net.Conn, error)
- func (c *Statistic) Conns(context.Context, *emptypb.Empty) (*statistic.ConnResp, error)
- func (c *Statistic) PacketConn(host string) (net.PacketConn, error)
- func (c *Statistic) RemoveClient(id int64)
- func (c *Statistic) Statistic(_ *emptypb.Empty, srv statistic.Connections_StatisticServer) error
Constants ¶
This section is empty.
Variables ¶
View Source
var BYPASS_DATA []byte
go:embed statics/bypass.gz
View Source
var Mode = map[string]*MODE{ "direct": &DIRECT, "block": &BLOCK, }
Functions ¶
Types ¶
type Shunt ¶
type Shunt struct {
// contains filtered or unexported fields
}
type Statistic ¶
type Statistic struct { statistic.UnimplementedConnectionsServer // contains filtered or unexported fields }
func NewStatistic ¶
func NewStatistic(conf config.ConfigObserver, dialer proxy.Proxy) *Statistic
func (*Statistic) AddDownload ¶
func (c *Statistic) AddDownload(n uint64)
func (*Statistic) PacketConn ¶
func (c *Statistic) PacketConn(host string) (net.PacketConn, error)
func (*Statistic) RemoveClient ¶
func (c *Statistic) RemoveClient(id int64)
Click to show internal directories.
Click to hide internal directories.