Documentation ¶
Overview ¶
Package config is responsible for parsing and validating cmd arguments.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // RequestURL is the URL where the target request will be sent. RequestURL *url.URL // Method is the HTTP method of the request. Method string // Head signals that the tool should only fetch headers. If specified, // headers will be written to the output. Head bool // Data specifies the data to be sent to the HTTP server. Data string // Headers is the HTTP headers that will be added to the request. Headers http.Header // ProxyURL is a URL of a proxy to use with this connection. ProxyURL *url.URL // ConnectTo is a mapping of "host1:port1" to "host2:port2" pairs that // allows retargeting the connection. ConnectTo map[string]string // Insecure disables TLS verification of the connection. Insecure bool // TLSMinVersion is a minimum supported TLS version. TLSMinVersion uint16 // TLSMaxVersion is a maximum supported TLS version. TLSMaxVersion uint16 // ForceHTTP11 forces using HTTP/1.1. ForceHTTP11 bool // ForceHTTP2 forces using HTTP/2. ForceHTTP2 bool // ForceHTTP2 forces using HTTP/3. ForceHTTP3 bool // ECH forces usage of Encrypted Client Hello for the request. If other // ECH-related fields are not specified, the ECH configuration will be // received from the DNS settings. ECH bool // ECHConfigs is a set of ECH configurations that will be used when opening // an encrypted connection. ECHConfigs []ctls.ECHConfig // Resolve is a map of host:ips pairs. It allows specifying custom IP // addresses for a specific host or all hosts (if '*' is used instead of // the host name). Resolve map[string][]net.IP // TLSSplitChunkSize is a size of the first chunk of ClientHello that is // sent to the server. TLSSplitChunkSize int // TLSSplitDelay is a delay in milliseconds before sending the second // chunk of ClientHello. TLSSplitDelay int // OutputJSON enables writing output in JSON format. OutputJSON bool // OutputPath defines where to write the received data. If not set, the // received data will be written to stdout. OutputPath string // Verbose defines whether we should write the DEBUG-level log or not. Verbose bool // RawOptions is the raw command-line arguments struct (for logging only). RawOptions *Options }
Config is a strictly-typed and validated configuration structure which is created from Options (command-line arguments).
func ParseConfig ¶
ParseConfig parses and validates os.Args and returns the final *Config object.
type Options ¶
type Options struct { // URL represents the address the request will be made to. It is always the // last argument. URL string `long:"url" description:"URL the request will be made to. Can be specified without any flags." value-name:"<URL>"` // Method is the HTTP method to be used. Method string `short:"X" long:"request" description:"HTTP method. GET by default." value-name:"<method>"` // Data specifies the data to be sent to the HTTP server. Data string `` /* 153-byte string literal not displayed */ // Headers is an array of HTTP headers (format is "header: value") to // include in the request. Headers []string `short:"H" long:"header" description:"Extra header to include in the request. Can be specified multiple times."` // ProxyURL is a URL of a proxy to use with this connection. ProxyURL string `` /* 178-byte string literal not displayed */ // ConnectTo allows to override the connection target, i.e. for a request // to the given HOST1:PORT1 pair, connect to HOST2:PORT2 instead. ConnectTo []string `` /* 180-byte string literal not displayed */ // Head signals that the tool should only fetch headers. If specified, // headers will be written to the output. Head bool `short:"I" long:"head" description:"Fetch the headers only." optional:"yes" optional-value:"true"` // Insecure disables TLS verification of the connection. Insecure bool `short:"k" long:"insecure" description:"Disables TLS verification of the connection." optional:"yes" optional-value:"true"` // TLSv13 forces to use TLS v1.3. TLSv13 bool `long:"tlsv1.3" description:"Forces gocurl to use TLS v1.3." optional:"yes" optional-value:"true"` // TLSv13 forces to use TLS v1.2. TLSv12 bool `long:"tlsv1.2" description:"Forces gocurl to use TLS v1.2." optional:"yes" optional-value:"true"` // HTTPv11 forces to use HTTP v1.1. HTTPv11 bool `long:"http1.1" description:"Forces gocurl to use HTTP v1.1." optional:"yes" optional-value:"true"` // HTTPv2 forces to use HTTP v2. HTTPv2 bool `long:"http2" description:"Forces gocurl to use HTTP v2." optional:"yes" optional-value:"true"` // HTTPv3 forces to use HTTP v3. HTTPv3 bool `long:"http3" description:"Forces gocurl to use HTTP v2." optional:"yes" optional-value:"true"` // ECH forces usage of Encrypted Client Hello for the request. If other // ECH-related fields are not specified, the ECH configuration will be // received from the DNS settings. ECH bool `long:"ech" description:"Enables ECH support for the request." optional:"yes" optional-value:"true"` // ECHConfig is a custom ECH configuration to use for this request. If this // option is specified, there will be no attempt to discover the ECH // configuration using DNS. ECHConfig string `` /* 149-byte string literal not displayed */ // Resolve allows to provide a custom address for a specific host and port // pair. Supports '*' instead of the host name to cover all hosts. Resolve []string `` /* 219-byte string literal not displayed */ // TLSSplitHello is an option that allows splitting TLS ClientHello in two // parts in order to avoid common DPI systems detecting TLS. CHUNKSIZE is // the size of the first bytes before ClientHello is split, DELAY is delay // in milliseconds before sending the second part. TLSSplitHello string `` /* 313-byte string literal not displayed */ // OutputJSON enables writing output in JSON format. OutputJSON bool `` /* 128-byte string literal not displayed */ // OutputPath defines where to write the received data. If not set, gocurl // will write everything to stdout. OutputPath string `` /* 151-byte string literal not displayed */ // Verbose defines whether we should write the DEBUG-level log or not. Verbose bool `short:"v" long:"verbose" description:"Verbose output (optional)." optional:"yes" optional-value:"true"` }
Options represents command-line arguments.
Click to show internal directories.
Click to hide internal directories.