ipscanner

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 License: MIT, MIT Imports: 7 Imported by: 0

README

IPScanner

IPScanner is a Go package designed for scanning and analyzing IP addresses. It utilizes various dialers and an internal engine to perform scans efficiently.

Features

  • IPv4 and IPv6 support.
  • Customizable timeout and dialer options.
  • Extendable with various ping methods (HTTP, QUIC, TCP, TLS).
  • Adjustable IP Queue size for scan optimization.

Getting Started

To use IPScanner, simply import the package and initialize a new scanner with your desired options.

import "github.com/bepass-org/warp-plus/ipscanner"

func main() {
    scanner := ipscanner.NewScanner(
        // Configure your options here
    )
    scanner.Run()
}

Options

You can customize your scanner with several options:

  • WithUseIPv4 and WithUseIPv6 to specify IP versions.
  • WithDialer and WithTLSDialer to define custom dialing functions.
  • WithTimeout to set the scan timeout.
  • WithIPQueueSize to set the IP Queue size.
  • WithPingMethod to set the ping method, it can be HTTP, QUIC, TCP, TLS at the same time.
  • Various other options for detailed scan control.

Contributing

Contributions to IPScanner are welcome. Please ensure to follow the project's coding standards and submit detailed pull requests.

License

IPScanner is licensed under the MIT license. See LICENSE for more information.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IPInfo

type IPInfo = statute.IPInfo

type IPScanner

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

func NewScanner

func NewScanner(options ...Option) *IPScanner

func (*IPScanner) GetAvailableIPs

func (i *IPScanner) GetAvailableIPs() []statute.IPInfo

func (*IPScanner) Run

func (i *IPScanner) Run(ctx context.Context)

type Option

type Option func(*IPScanner)

func WithCidrList

func WithCidrList(cidrList []netip.Prefix) Option

func WithConnectionTimeout

func WithConnectionTimeout(timeout time.Duration) Option

func WithDialer

func WithDialer(d statute.TDialerFunc) Option

func WithDisableCompression

func WithDisableCompression(disableCompression bool) Option

func WithHTTPPing

func WithHTTPPing() Option

func WithHandshakeTimeout

func WithHandshakeTimeout(timeout time.Duration) Option

func WithHostname

func WithHostname(hostname string) Option

func WithHttpClientFunc

func WithHttpClientFunc(h statute.THTTPClientFunc) Option

func WithHttpPath

func WithHttpPath(path string) Option

func WithIPQueueSize

func WithIPQueueSize(size int) Option

func WithIPQueueTTL

func WithIPQueueTTL(ttl time.Duration) Option

func WithInsecureSkipVerify

func WithInsecureSkipVerify(insecureSkipVerify bool) Option

func WithLogger

func WithLogger(logger *slog.Logger) Option

func WithMaxDesirableRTT

func WithMaxDesirableRTT(threshold time.Duration) Option

func WithPort

func WithPort(port uint16) Option

func WithQUICPing

func WithQUICPing() Option

func WithQuicDialer

func WithQuicDialer(q statute.TQuicDialerFunc) Option

func WithReferrer

func WithReferrer(referrer string) Option

func WithTCPPing

func WithTCPPing() Option

func WithTLSDialer

func WithTLSDialer(t statute.TDialerFunc) Option

func WithTLSPing

func WithTLSPing() Option

func WithTlsVersion

func WithTlsVersion(version uint16) Option

func WithUseHTTP2

func WithUseHTTP2(useHTTP2 bool) Option

func WithUseHTTP3

func WithUseHTTP3(useHTTP3 bool) Option

func WithUseIPv4

func WithUseIPv4(useIPv4 bool) Option

func WithUseIPv6

func WithUseIPv6(useIPv6 bool) Option

func WithUserAgent

func WithUserAgent(userAgent string) Option

func WithWarpPeerPublicKey

func WithWarpPeerPublicKey(peerPublicKey string) Option

func WithWarpPing

func WithWarpPing() Option

func WithWarpPreSharedKey

func WithWarpPreSharedKey(presharedKey string) Option

func WithWarpPrivateKey

func WithWarpPrivateKey(privateKey string) Option

Directories

Path Synopsis
example
internal

Jump to

Keyboard shortcuts

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