Documentation
¶
Index ¶
- Variables
- func FetchExternalIP() (net.IP, error)
- func GetClient(ctx context.Context, addr, secret string) (context.Context, tpb.TunnelClient, *grpc.ClientConn, error)
- func GetDNSLogClient(addr string) (tpb.DNSLogClient, *grpc.ClientConn, error)
- func GetExternalIP() (net.IP, error)
- func GetSupportDNSLogBroker(mode string) dnslogbrokers.DNSLogBroker
- func GetSupportDNSLogBrokersName() []string
- func GetTunnelServerCommandCli() *cli.App
- func GetTunnelServerExternalIP(addr string, secret string) (net.IP, error)
- func HoldingCreateTunnelClient(client tpb.Tunnel_CreateTunnelClient, localhost string, localport int, ...) error
- func MirrorLocalPortToRemote(network string, localPort int, remotePort int, id string, addr, secret string, ...) error
- func MirrorLocalPortToRemoteEx(network string, localHost string, localPort int, remotePort int, id string, ...) error
- func MirrorLocalPortToRemoteWithRegisterEx(enableRegister bool, pubKey []byte, grpcSecret string, verbose string, ...) (fErr error)
- func QueryExistedDNSLogEvents(addr, token, mode string) ([]*tpb.DNSLogEvent, error)
- func QueryExistedDNSLogEventsByLocal(token, mode string) ([]*tpb.DNSLogEvent, error)
- func QueryExistedDNSLogEventsByLocalEx(token, mode string, timeout ...float64) ([]*tpb.DNSLogEvent, error)
- func QueryExistedDNSLogEventsEx(addr, token, mode string, timeout ...float64) ([]*tpb.DNSLogEvent, error)
- func QueryExistedHTTPLog(addr string, token string, timeout ...float64) (*tpb.QueryExistedHTTPRequestTriggerResponse, error)
- func QueryExistedRandomPortTriggerEvents(token, addr, secret string, ctx context.Context) (*tpb.RandomPortTriggerEvent, error)
- func QueryICMPLengthTriggerNotifications(length int, addr, secret string, ctx context.Context) (*tpb.ICMPTriggerNotification, error)
- func RemoveTunnel(id string)
- func RequireDNSLogDomainByLocal(mode string) (string, string, string, error)
- func RequireDNSLogDomainByRemote(addr, mode string) (string, string, string, error)
- func RequireHTTPLogDomainByRemote(addr string, i ...any) (string, string, string, error)
- func RequirePortByToken(token string, addr, secret string, ctx context.Context) (*tpb.RequireRandomPortTriggerResponse, error)
- type DNSLogGRPCServer
- type HTTPTrigger
- func (t *HTTPTrigger) QueryResults(token string) ([]*tpb.HTTPRequestTriggerNotification, bool)
- func (t *HTTPTrigger) Register(token string, response func([]byte) []byte) ([]string, error)
- func (t *HTTPTrigger) Serve() error
- func (t *HTTPTrigger) SetHTTPPort(i int)
- func (t *HTTPTrigger) SetHTTPSPort(i int)
- type ICMPTrigger
- type ICMPTriggerNotification
- type RandomPortTrigger
- type TriggerNotification
- type Tunnel
- type TunnelClientConn
- type TunnelServer
- func (s *TunnelServer) CheckServerReachable(ctx context.Context, req *tpb.CheckServerReachableRequest) (*tpb.CheckServerReachableResponse, error)
- func (s *TunnelServer) CreateTunnel(server tpb.Tunnel_CreateTunnelServer) error
- func (t *TunnelServer) GetAllRegisteredTunnel(ctx context.Context, req *tpb.GetAllRegisteredTunnelRequest) (*tpb.GetAllRegisteredTunnelResponse, error)
- func (t *TunnelServer) GetRegisteredTunnelDescriptionByID(ctx context.Context, req *tpb.GetRegisteredTunnelDescriptionByIDRequest) (*tpb.RegisteredTunnel, error)
- func (s *TunnelServer) InitialReverseTrigger() error
- func (s *TunnelServer) QueryExistedDNSLog(ctx context.Context, params *tpb.QueryExistedDNSLogParams) (*tpb.QueryExistedDNSLogResponse, error)
- func (t *TunnelServer) QueryExistedHTTPRequestTrigger(ctx context.Context, req *tpb.QueryExistedHTTPRequestTriggerRequest) (*tpb.QueryExistedHTTPRequestTriggerResponse, error)
- func (t *TunnelServer) QueryExistedRandomPortTrigger(c context.Context, req *tpb.QueryExistedRandomPortTriggerRequest) (*tpb.QueryExistedRandomPortTriggerResponse, error)
- func (s *TunnelServer) QuerySpecificICMPLengthTrigger(ctx context.Context, req *tpb.QuerySpecificICMPLengthTriggerParams) (*tpb.QuerySpecificICMPLengthTriggerResponse, error)
- func (s *TunnelServer) RegisterTunnel(ctx context.Context, req *tpb.RegisterTunnelRequest) (*tpb.RegisterTunnelResponse, error)
- func (s *TunnelServer) RemoteIP(ctx context.Context, req *tpb.Empty) (*tpb.RemoteIPResponse, error)
- func (s *TunnelServer) RequireDomain(ctx context.Context, params *tpb.RequireDomainParams) (*tpb.RequireDomainResponse, error)
- func (t *TunnelServer) RequireHTTPRequestTrigger(ctx context.Context, req *tpb.RequireHTTPRequestTriggerParams) (*tpb.RequireHTTPRequestTriggerResponse, error)
- func (t *TunnelServer) RequireRandomPortTrigger(ctx context.Context, req *tpb.RequireRandomPortTriggerParams) (*tpb.RequireRandomPortTriggerResponse, error)
- type TunnelServerConn
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultExternalIP *net.IP
Functions ¶
func FetchExternalIP ¶
func GetClient ¶
func GetClient(ctx context.Context, addr, secret string) (context.Context, tpb.TunnelClient, *grpc.ClientConn, error)
func GetDNSLogClient ¶
func GetDNSLogClient(addr string) (tpb.DNSLogClient, *grpc.ClientConn, error)
func GetExternalIP ¶ added in v1.3.3
func GetSupportDNSLogBroker ¶ added in v1.2.6
func GetSupportDNSLogBroker(mode string) dnslogbrokers.DNSLogBroker
func GetSupportDNSLogBrokersName ¶ added in v1.2.6
func GetSupportDNSLogBrokersName() []string
func MirrorLocalPortToRemote ¶
func QueryExistedDNSLogEvents ¶
func QueryExistedDNSLogEvents(addr, token, mode string) ([]*tpb.DNSLogEvent, error)
func QueryExistedDNSLogEventsByLocal ¶ added in v1.2.6
func QueryExistedDNSLogEventsByLocal(token, mode string) ([]*tpb.DNSLogEvent, error)
func QueryExistedDNSLogEventsByLocalEx ¶ added in v1.2.6
func QueryExistedDNSLogEventsByLocalEx(token, mode string, timeout ...float64) ([]*tpb.DNSLogEvent, error)
func QueryExistedDNSLogEventsEx ¶ added in v1.2.2
func QueryExistedDNSLogEventsEx(addr, token, mode string, timeout ...float64) ([]*tpb.DNSLogEvent, error)
func QueryExistedHTTPLog ¶ added in v1.3.3
func RemoveTunnel ¶
func RemoveTunnel(id string)
func RequireDNSLogDomainByLocal ¶ added in v1.2.6
func RequireDNSLogDomainByRemote ¶ added in v1.2.6
func RequireHTTPLogDomainByRemote ¶ added in v1.3.3
func RequirePortByToken ¶
Types ¶
type DNSLogGRPCServer ¶ added in v1.3.3
type DNSLogGRPCServer struct { tpb.DNSLogServer ExternalIP string // contains filtered or unexported fields }
func NewDNSLogServer ¶ added in v1.3.3
func NewDNSLogServer(domain string, externalIP string) (*DNSLogGRPCServer, error)
func (*DNSLogGRPCServer) QueryExistedDNSLog ¶ added in v1.3.3
func (D *DNSLogGRPCServer) QueryExistedDNSLog(ctx context.Context, params *tpb.QueryExistedDNSLogParams) (*tpb.QueryExistedDNSLogResponse, error)
func (*DNSLogGRPCServer) RequireDomain ¶ added in v1.3.3
func (D *DNSLogGRPCServer) RequireDomain(ctx context.Context, params *tpb.RequireDomainParams) (*tpb.RequireDomainResponse, error)
type HTTPTrigger ¶ added in v1.3.3
type HTTPTrigger struct {
// contains filtered or unexported fields
}
func NewHTTPTrigger ¶ added in v1.3.3
func NewHTTPTrigger(external string, dnslogDomain string) (*HTTPTrigger, error)
func (*HTTPTrigger) QueryResults ¶ added in v1.3.3
func (t *HTTPTrigger) QueryResults(token string) ([]*tpb.HTTPRequestTriggerNotification, bool)
func (*HTTPTrigger) Serve ¶ added in v1.3.3
func (t *HTTPTrigger) Serve() error
func (*HTTPTrigger) SetHTTPPort ¶ added in v1.3.3
func (t *HTTPTrigger) SetHTTPPort(i int)
func (*HTTPTrigger) SetHTTPSPort ¶ added in v1.3.3
func (t *HTTPTrigger) SetHTTPSPort(i int)
type ICMPTrigger ¶
type ICMPTrigger struct {
// contains filtered or unexported fields
}
func NewICMPTrigger ¶
func NewICMPTrigger() (*ICMPTrigger, error)
func (*ICMPTrigger) GetICMPTriggerNotification ¶
func (p *ICMPTrigger) GetICMPTriggerNotification(i int) (*ICMPTriggerNotification, error)
func (*ICMPTrigger) Run ¶
func (p *ICMPTrigger) Run() error
type ICMPTriggerNotification ¶
type ICMPTriggerNotification struct { Size int CurrentRemoteAddr string Histories []string CurrentRemoteCachedConnectionCount int SizeCachedHistoryConnectionCount int TriggerTimestamp int64 Timestamp int64 }
func (*ICMPTriggerNotification) Show ¶
func (t *ICMPTriggerNotification) Show()
type RandomPortTrigger ¶
type RandomPortTrigger struct {
// contains filtered or unexported fields
}
func NewRandomPortTrigger ¶
func NewRandomPortTrigger() (*RandomPortTrigger, error)
func (*RandomPortTrigger) GetTriggerNotification ¶
func (p *RandomPortTrigger) GetTriggerNotification(port int) (*TriggerNotification, error)
func (*RandomPortTrigger) Run ¶
func (p *RandomPortTrigger) Run() error
type TriggerNotification ¶
type TriggerNotification struct { LocalPort int CurrentRemoteAddr string Histories []string CurrentRemoteCachedConnectionCount int LocalPortCachedHistoryConnectionCount int TriggerTimestamp int64 Timestamp int64 }
func (*TriggerNotification) Show ¶
func (t *TriggerNotification) Show()
type Tunnel ¶
type Tunnel struct { Id string Host string Port int PublicKeyPEM []byte Secret string Verbose string // finished / registered / working Status string }
func GetTunnels ¶
func GetTunnels() []*Tunnel
type TunnelClientConn ¶
type TunnelClientConn struct {
// contains filtered or unexported fields
}
func NewTunnelClientConn ¶
func NewTunnelClientConn(id string, remoteAddr string, reader chan []byte, stream tpb.Tunnel_CreateTunnelClient) *TunnelClientConn
func (*TunnelClientConn) Close ¶
func (s *TunnelClientConn) Close() error
type TunnelServer ¶
type TunnelServer struct { tpb.TunnelServer ExternalIP string DNSLogDomain string // 二级密码是用来分别 SecondaryPassword string }
func NewTunnelServer ¶
func NewTunnelServer(dnslogDomain, externalIPConfigged string) (*TunnelServer, error)
func (*TunnelServer) CheckServerReachable ¶
func (s *TunnelServer) CheckServerReachable(ctx context.Context, req *tpb.CheckServerReachableRequest) (*tpb.CheckServerReachableResponse, error)
func (*TunnelServer) CreateTunnel ¶
func (s *TunnelServer) CreateTunnel(server tpb.Tunnel_CreateTunnelServer) error
func (*TunnelServer) GetAllRegisteredTunnel ¶
func (t *TunnelServer) GetAllRegisteredTunnel(ctx context.Context, req *tpb.GetAllRegisteredTunnelRequest) (*tpb.GetAllRegisteredTunnelResponse, error)
func (*TunnelServer) GetRegisteredTunnelDescriptionByID ¶
func (t *TunnelServer) GetRegisteredTunnelDescriptionByID(ctx context.Context, req *tpb.GetRegisteredTunnelDescriptionByIDRequest) (*tpb.RegisteredTunnel, error)
func (*TunnelServer) InitialReverseTrigger ¶
func (s *TunnelServer) InitialReverseTrigger() error
func (*TunnelServer) QueryExistedDNSLog ¶
func (s *TunnelServer) QueryExistedDNSLog(ctx context.Context, params *tpb.QueryExistedDNSLogParams) (*tpb.QueryExistedDNSLogResponse, error)
func (*TunnelServer) QueryExistedHTTPRequestTrigger ¶ added in v1.3.3
func (t *TunnelServer) QueryExistedHTTPRequestTrigger(ctx context.Context, req *tpb.QueryExistedHTTPRequestTriggerRequest) (*tpb.QueryExistedHTTPRequestTriggerResponse, error)
func (*TunnelServer) QueryExistedRandomPortTrigger ¶
func (t *TunnelServer) QueryExistedRandomPortTrigger(c context.Context, req *tpb.QueryExistedRandomPortTriggerRequest) (*tpb.QueryExistedRandomPortTriggerResponse, error)
func (*TunnelServer) QuerySpecificICMPLengthTrigger ¶
func (s *TunnelServer) QuerySpecificICMPLengthTrigger(ctx context.Context, req *tpb.QuerySpecificICMPLengthTriggerParams) (*tpb.QuerySpecificICMPLengthTriggerResponse, error)
func (*TunnelServer) RegisterTunnel ¶
func (s *TunnelServer) RegisterTunnel(ctx context.Context, req *tpb.RegisterTunnelRequest) (*tpb.RegisterTunnelResponse, error)
func (*TunnelServer) RemoteIP ¶
func (s *TunnelServer) RemoteIP(ctx context.Context, req *tpb.Empty) (*tpb.RemoteIPResponse, error)
func (*TunnelServer) RequireDomain ¶
func (s *TunnelServer) RequireDomain(ctx context.Context, params *tpb.RequireDomainParams) (*tpb.RequireDomainResponse, error)
func (*TunnelServer) RequireHTTPRequestTrigger ¶ added in v1.3.3
func (t *TunnelServer) RequireHTTPRequestTrigger(ctx context.Context, req *tpb.RequireHTTPRequestTriggerParams) (*tpb.RequireHTTPRequestTriggerResponse, error)
func (*TunnelServer) RequireRandomPortTrigger ¶
func (t *TunnelServer) RequireRandomPortTrigger(ctx context.Context, req *tpb.RequireRandomPortTriggerParams) (*tpb.RequireRandomPortTriggerResponse, error)
type TunnelServerConn ¶
type TunnelServerConn struct { io.ReadWriteCloser // contains filtered or unexported fields }
func NewTunnelServerConn ¶
func NewTunnelServerConn(id string, desc *connectionDesc, stream tpb.Tunnel_CreateTunnelServer) *TunnelServerConn
func (*TunnelServerConn) Close ¶
func (s *TunnelServerConn) Close() error
Source Files
¶
Click to show internal directories.
Click to hide internal directories.