socks5

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ScanType     = "socks"
	SOCKSVersion = 5
)
View Source
const MethodNoAuth = 0

Variables

This section is empty.

Functions

This section is empty.

Types

type MethodReply

type MethodReply struct {
	Ver    byte // version of the protocol
	Method byte // server selects from one of the methods given in the request METHODS field.
}

MethodReply is a negotiation reply for the authentication method to be used. From RFC1928: +----+--------+ |VER | METHOD | +----+--------+ | 1 | 1 | +----+--------+

func (*MethodReply) Len

func (*MethodReply) Len() int64

func (*MethodReply) ReadFrom

func (r *MethodReply) ReadFrom(in io.Reader) (int64, error)

type MethodRequest

type MethodRequest struct {
	Ver      byte // version of the protocol
	NMethods byte // number of method identifier octets that appear in the METHODS field.
	Methods  []byte
}

MethodRequest is a negotiation request for the authentication method to be used. It is the initial message that the client sends to the SOCKS5 server. From RFC1928: +----+----------+----------+ |VER | NMETHODS | METHODS | +----+----------+----------+ | 1 | 1 | 1 to 255 | +----+----------+----------+

func NewMethodRequest

func NewMethodRequest(version byte, methods ...byte) *MethodRequest

func (*MethodRequest) Len

func (r *MethodRequest) Len() int64

func (*MethodRequest) WriteTo

func (r *MethodRequest) WriteTo(w io.Writer) (int64, error)

type ScanResult

type ScanResult struct {
	ScanType string `json:"scan"`
	Version  int    `json:"version"`
	IP       string `json:"ip"`
	Port     uint16 `json:"port"`
	Auth     bool   `json:"auth,omitempty"`
}

func (*ScanResult) ID

func (r *ScanResult) ID() string

func (*ScanResult) MarshalJSON

func (r *ScanResult) MarshalJSON() ([]byte, error)

func (*ScanResult) String

func (r *ScanResult) String() string

type Scanner

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

func NewScanner

func NewScanner(opts ...ScannerOption) *Scanner

func (*Scanner) Scan

func (s *Scanner) Scan(ctx context.Context, r *scan.Request) (result scan.Result, err error)

type ScannerOption

type ScannerOption func(*Scanner)

func WithDataTimeout

func WithDataTimeout(timeout time.Duration) ScannerOption

func WithDialTimeout

func WithDialTimeout(timeout time.Duration) ScannerOption

Jump to

Keyboard shortcuts

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