Documentation
¶
Index ¶
- Constants
- func CheckAddr(url *url.URL) string
- func Contains(Value []hpack.HeaderField, Data hpack.HeaderField) bool
- func TurnCookieHeader(Cookies []string) string
- func UserAgent() string
- type Client
- func (Data *Client) CheckQuery() *Client
- func (Data *Client) DefaultRequest(method, addr string, config ReqConfig) (Res Response, err error)
- func (Datas *Client) FindData(req ReqConfig) (Config Response, err error)
- func (Data *Client) FormHeaderBytes(headers []string) []byte
- func (Data *Client) GenerateConn(config ReqConfig) error
- func (Data *Client) GetCookie(cookie_name, url string) string
- func (Data *Client) GetHeaders(method string) *Client
- func (Data *Client) GrabUrl(addr, method string) *Client
- func (Data *Client) SendHeaders(endStream bool)
- func (Data *Client) SendSettings(method string)
- func (Data *Client) Send_Prio_Frames()
- func (Data *Client) TransformCookies(url string) string
- func (Data *Client) Windows_Update()
- func (Data *Client) WriteSettings()
- type Config
- type ReqConfig
- type Response
- type Website
Constants ¶
const ( MethodGet = "GET" MethodPost = "POST" MethodPut = "PUT" MethodOptions = "OPTIONS" MethodDelete = "DELETE" MethodConnect = "CONNECT" )
Variables ¶
This section is empty.
Functions ¶
func CheckAddr ¶
Takes in the url and returns the host + port of the url.
e.g. "www.google.com:443"
func Contains ¶
func Contains(Value []hpack.HeaderField, Data hpack.HeaderField) bool
Helper function that checks if a Cookie or other form of header is already Applied in your list of headers.
func TurnCookieHeader ¶
Types ¶
type Client ¶
type Client struct { Config Config Ja3 string Cookies map[string][]hpack.HeaderField // Used to store the data of websites cookies Client Website }
func (*Client) CheckQuery ¶
Checks if there are params in your url and adds it to your path.
e.g. "/api/name?code=12343&scope=1234"
func (*Client) DefaultRequest ¶
func (*Client) FindData ¶
Find data is called after the requests are performed, it looks the frames of the framer and returns its data, any errors and also headers / status codes.
func (*Client) FormHeaderBytes ¶
Form header bytes takes the []string of headers and turns it into []byte data this is so it can be compatiable for the http2 headers.
func (*Client) GenerateConn ¶
Generate conn performs a conn to the url you supply. Makes all the config options and sets JA3 if given a value. TODO: Add proxy support.
func (*Client) GetCookie ¶
gets a selected cookie based on the cookie_name variable
e.g. "__vf_bm" > "__vf_bm=awdawd223reqfqh32rqrf32qr" (example value)
func (*Client) GetHeaders ¶
Loops over the Config headers and applies them to the Client []string variable. Method for example "GET".
func (*Client) GrabUrl ¶
Determines if the url is a IP address or not. This also checks if theres a path present, default to "/" if none.
e.g. "Data.Client.url.Host = addr" > 127.0.0.2 e.g. "https://website.com" > "https://website.com/"
func (*Client) SendHeaders ¶
Writes the headers to the http2 framer. this function also encodes the headers into a []byte Endstream is also called in this function, only use true values when performing GET requests.
func (*Client) SendSettings ¶
This function writes the settings, windows update, prio frames gets the headers AND sends them.
func (*Client) Send_Prio_Frames ¶
func (Data *Client) Send_Prio_Frames()
func (*Client) TransformCookies ¶
This is a helper function that gets all the cookies from a cached url and returns them in a format that works with the cookie: header.
func (*Client) Windows_Update ¶
func (Data *Client) Windows_Update()
Writes the window update frame to the http2 framer.
e.g. "Data.Client.Conn.WriteWindowUpdate(0, 15663105)"
func (*Client) WriteSettings ¶
func (Data *Client) WriteSettings()
Write settings writes the default chrome settings to the framer
e.g. "ID: http2.SettingHeaderTableSize, Val: 65536" e.g. "ID: http2.SettingMaxConcurrentStreams, Val: 1000" e.g. "ID: http2.SettingInitialWindowSize, Val: 6291456" e.g. "ID: http2.SettingMaxHeaderListSize, Val: 262144,"
type Config ¶
type Config struct { HeaderOrder []string Headers map[string]string Protocols []string CapitalizeHeaders bool Debug bool }
func GetDefaultConfig ¶
func GetDefaultConfig() Config
This returns the default config variables. header order, chrome like headers and protocols.
type ReqConfig ¶
type ReqConfig struct { Data []byte Cookies string Ciphersuites []uint16 Certificates []tls.Certificate CurvePreferences []tls.CurveID Renegotiation tls.RenegotiationSupport ClientAuth tls.ClientAuthType InsecureSkipVerify bool Proxy string // https://user:pass@ip:port SaveCookies bool PreferServerCipherSuites bool RootCAs *x509.CertPool ClientCAs *x509.CertPool }