Documentation
¶
Index ¶
- Variables
- func CloneIP(ip netip.Addr) netip.Addr
- func DefaultDialerFunc(ctx context.Context, network, addr string) (net.Conn, error)
- func DefaultHTTPClientFunc(rawDialer TDialerFunc, tlsDialer TDialerFunc, quicDialer TQuicDialerFunc, ...) *http.Client
- func DefaultIPQueueChangeCallback(ips []IPInfo)
- func DefaultQuicDialerFunc(ctx context.Context, addr string, _ *tls.Config, _ *quic.Config) (quic.EarlyConnection, error)
- func DefaultTLSDialerFunc(ctx context.Context, network, addr string) (net.Conn, error)
- func IsIPv4(ip netip.Addr) bool
- func IsIPv6(ip netip.Addr) bool
- func RandomWarpPort() int
- func TlsVersionToString(ver uint16) string
- type DefaultLogger
- type IPInfQueue
- type IPInfo
- type IPing
- type IPingResult
- type Logger
- type ScannerOptions
- type TDialerFunc
- type THTTPClientFunc
- type TIPQueueChangeCallback
- type TQuicDialerFunc
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultCFRanges = []string{
"103.21.244.0/22",
"103.22.200.0/22",
"103.31.4.0/22",
"104.16.0.0/12",
"108.162.192.0/18",
"131.0.72.0/22",
"141.101.64.0/18",
"162.158.0.0/15",
"172.64.0.0/13",
"173.245.48.0/20",
"188.114.96.0/20",
"190.93.240.0/20",
"197.234.240.0/22",
"198.41.128.0/17",
"2400:cb00::/32",
"2405:8100::/32",
"2405:b500::/32",
"2606:4700::/32",
"2803:f800::/32",
"2c0f:f248::/32",
"2a06:98c0::/29",
}
View Source
var HTTPPing = 1 << 1
View Source
var QUICPing = 1 << 4
View Source
var TCPPing = 1 << 3
View Source
var TLSPing = 1 << 2
View Source
var WARPPing = 1 << 5
Functions ¶
func DefaultDialerFunc ¶
func DefaultHTTPClientFunc ¶
func DefaultHTTPClientFunc(rawDialer TDialerFunc, tlsDialer TDialerFunc, quicDialer TQuicDialerFunc, targetAddr ...string) *http.Client
func DefaultIPQueueChangeCallback ¶
func DefaultIPQueueChangeCallback(ips []IPInfo)
func DefaultQuicDialerFunc ¶
func DefaultTLSDialerFunc ¶
DefaultTLSDialerFunc is a custom TLS dialer function
func RandomWarpPort ¶ added in v1.0.1
func RandomWarpPort() int
func TlsVersionToString ¶
Types ¶
type DefaultLogger ¶
type DefaultLogger struct{}
func (DefaultLogger) Debug ¶
func (l DefaultLogger) Debug(s string, v ...interface{})
func (DefaultLogger) Error ¶
func (l DefaultLogger) Error(s string, v ...interface{})
type IPInfQueue ¶
type IPInfQueue struct {
// contains filtered or unexported fields
}
func (*IPInfQueue) Dequeue ¶
func (q *IPInfQueue) Dequeue() IPInfo
Dequeue removes and returns the item with the lowest RTT.
func (*IPInfQueue) Enqueue ¶
func (q *IPInfQueue) Enqueue(item IPInfo)
Enqueue adds an item and then sorts the queue.
func (*IPInfQueue) Size ¶
func (q *IPInfQueue) Size() int
Size returns the number of items in the queue.
type IPing ¶
type IPing interface {
Ping() IPingResult
PingContext(context.Context) IPingResult
}
type ScannerOptions ¶
type ScannerOptions struct {
UseIPv4 bool
UseIPv6 bool
CidrList []string // CIDR ranges to scan
SelectedOps int
Logger Logger
InsecureSkipVerify bool
RawDialerFunc TDialerFunc
TLSDialerFunc TDialerFunc
QuicDialerFunc TQuicDialerFunc
HttpClientFunc THTTPClientFunc
UseHTTP3 bool
UseHTTP2 bool
DisableCompression bool
HTTPPath string
Referrer string
UserAgent string
Hostname string
WarpPrivateKey string
WarpPeerPublicKey string
Port uint16
IPQueueSize int
IPQueueTTL time.Duration
MaxDesirableRTT int
IPQueueChangeCallback TIPQueueChangeCallback
ConnectionTimeout time.Duration
HandshakeTimeout time.Duration
TlsVersion uint16
}
var FinalOptions *ScannerOptions
type TDialerFunc ¶
type THTTPClientFunc ¶
type THTTPClientFunc func(rawDialer TDialerFunc, tlsDialer TDialerFunc, quicDialer TQuicDialerFunc, targetAddr ...string) *http.Client
type TIPQueueChangeCallback ¶
type TIPQueueChangeCallback func(ips []IPInfo)
Click to show internal directories.
Click to hide internal directories.