azuretls

package module
v0.0.0-...-ec699fd Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2022 License: MIT Imports: 15 Imported by: 0

README

azuretls-go

Documentation

Index

Constants

View Source
const (
	HeaderTableSize      = "HEADER_TABLE_SIZE"
	EnablePush           = "ENABLE_PUSH"
	MaxConcurrentStreams = "MAX_CONCURRENT_STREAMS"
	InitialWindowsSize   = "INITIAL_WINDOW_SIZE"
	MaxFrameSize         = "MAX_FRAME_SIZE"
	MaxHeaderListSize    = "MAX_HEADER_LIST_SIZE"
)

Variables

This section is empty.

Functions

func DecompressBody

func DecompressBody(Body []byte, encoding string) (parsedBody string)

DecompressBody unzips compressed data

func EnflateData

func EnflateData(data []byte) (resData []byte, err error)

func GUnzipData

func GUnzipData(data []byte) (resData []byte, err error)

func UnBrotliData

func UnBrotliData(data []byte) (resData []byte, err error)

Types

type Cookie struct {
	Name  string `json:"name"`
	Value string `json:"value"`

	Path    string `json:"path"`
	Domain  string `json:"domain"`
	Expires string `json:"expires"`

	MaxAge   int  `json:"max-age"`
	Secure   bool `json:"secure"`
	HttpOnly bool `json:"http-only"`
}

type HTTP2Settings

type HTTP2Settings struct {
	// contains filtered or unexported fields
}
type Header map[string]string

func (Header) Get

func (h Header) Get(key string) string

type Request

type Request struct {
	Method string `json:"method"`
	Url    string `json:"url"`
	Data   string `json:"data"`

	PHeader     []string `json:"pheader"`
	Header      Header   `json:"header"`
	HeaderOrder []string `json:"header-order"`

	Navigator string `json:"navigator"`

	Proxy         string `json:"proxy"`
	AllowRedirect bool   `json:"allow-redirect"`
	Timeout       int    `json:"timeout"`

	ServerPush bool `json:"server-push"`
	Verify     bool `json:"verify"`
}

type Response

type Response struct {
	StatusCode int `json:"status-code"`

	Cookies map[string]interface{} `json:"cookies"`
	Url     string                 `json:"url"`
	Headers Header                 `json:"headers"`
	Text    string                 `json:"body"`

	Content []byte

	IsBase64Encoded bool       `json:"is-base64-encoded"`
	ServerPush      []Response `json:"server-push"`
}

type Server

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

func InitApiRemote

func InitApiRemote(ip string, key string) *Server

InitApiRemote init api with ip and authorization key

func (*Server) InitSession

func (serv *Server) InitSession() (*Session, error)

InitSession create a new session on the API and return its struct.

func (*Server) Ping

func (serv *Server) Ping() bool

type Session

type Session struct {
	Header      Header
	PHeader     []string
	HeaderOrder []string

	Navigator string
	Cookies   map[string]string

	Timeout int
	Proxy   string
	// contains filtered or unexported fields
}

func (*Session) ApplyHTTP2Settings

func (s *Session) ApplyHTTP2Settings(settings []HTTP2Settings) bool

ApplyHTTP2Settings apply given HTTP2Settings to the current session (only on http2 requests)

func (*Session) ApplyJA3

func (s *Session) ApplyJA3(ja3 string, specifications map[string]interface{}) bool

ApplyJA3 apply your ja3 and its specifications to the current session

func (*Session) ApplyStreamPriorities

func (s *Session) ApplyStreamPriorities(streams []StreamInformation) bool

ApplyStreamPriorities apply given StreamInformation information to the current session (only on http2 requests)

func (*Session) ApplyWindowsUpdate

func (s *Session) ApplyWindowsUpdate(value int) bool

ApplyWindowsUpdate apply given value to the session's Windows update (only on http2 requests)

func (*Session) Close

func (s *Session) Close() bool

Close the current session

func (*Session) Do

func (s *Session) Do(request Request) (*Response, error)

Do the given Request.

func (*Session) GetCookies

func (s *Session) GetCookies(domain string) ([]Cookie, error)

GetCookies return cookies from a given domain

func (*Session) KeepAlive

func (s *Session) KeepAlive() bool

KeepAlive asks the API to keep the session up

func (*Session) SetCookies

func (s *Session) SetCookies(cookies []Cookie) bool

SetCookies set cookies into the current session

type Status

type Status struct {
	Success bool `json:"success"`
}

type StreamInformation

type StreamInformation struct {
	StreamId  uint32 `json:"stream-id"`
	StreamDep uint32 `json:"stream-dep"`
	Exclusive bool   `json:"exclusive"`
	Weight    uint8  `json:"weight"`
}

Jump to

Keyboard shortcuts

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