Documentation ¶
Overview ¶
Package proxyfy provides an api compatible http.Client for making requests All request are routed trough a random proxy provided by gimmeproxy.com For getting more requests visit https://a.paddle.com/v2/click/14088/32188?link=975
Index ¶
- type GimmeProxyConfig
- type Proxyfy
- func (c *Proxyfy) Do(req *http.Request) (resp *http.Response, err error)
- func (c *Proxyfy) Get(url string) (resp *http.Response, err error)
- func (c *Proxyfy) GetAllProxys() []*url.URL
- func (c *Proxyfy) GetRandomProxy() *url.URL
- func (c *Proxyfy) Head(url string) (resp *http.Response, err error)
- func (c *Proxyfy) Post(url string, contentType string, body io.Reader) (resp *http.Response, err error)
- func (c *Proxyfy) PostForm(url string, data url.Values) (resp *http.Response, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GimmeProxyConfig ¶
type GimmeProxyConfig struct { ApiKey string `url:"api_key,omitempty"` Get bool `url:"get,omitempty"` Post bool `url:"post,omitempty"` Cookies bool `url:"cookies,omitempty"` Referer bool `url:"referer,omitempty"` UserAgent bool `url:"user-agent,omitempty"` SupportsHTTPS bool `url:"supportsHttps,omitempty"` AnonymityLevel int `url:"anonymityLevel,omitempty"` Protocol string `url:"protocol,omitempty"` Port string `url:"port,omitempty"` Country string `url:"country,omitempty"` MaxCheckPeriod int `url:"maxCheckPeriod,omitempty"` Websites string `url:"websites,omitempty"` MinSpeed float64 `url:"minSpeed,omitempty"` NotCountry string `url:"notCountry,omitempty"` IPPort bool `url:"ipPort,omitempty"` Curl bool `url:"curl,omitempty"` }
type Proxyfy ¶
type Proxyfy struct {
// contains filtered or unexported fields
}
func NewProxyfy ¶
NewProxyfy sets up proxyfy with a minimal amount of input data It aready sets sane (in my eyes) defaults:
GimmeProxyConfig{ ApiKey: apiKey, Protocol: scheme, MaxCheckPeriod: 30, Get: true, Post: true, SupportsHTTPS: true, Referer:true, MinSpeed: 2000, }
func NewProxyfyAdvancedConfig ¶
func NewProxyfyAdvancedConfig(gimmeConfig GimmeProxyConfig) *Proxyfy
NewProxyfyAdvancedConfig sets up proxyfy with an advanced configuration. GimmeProxyConfig has following form (for documentation on the different values visit: https://gimmeproxy.com/#api)
type GimmeProxyConfig struct { ApiKey string Get bool Post bool Cookies bool Referer bool UserAgent bool SupportsHTTPS bool AnonymityLevel int Protocol string Port string Country string MaxCheckPeriod int Websites string MinSpeed float64 NotCountry string IPPort bool Curl bool }
func (*Proxyfy) GetAllProxys ¶
GetAllProxys returns a slice containing all proxies that are in use
func (*Proxyfy) GetRandomProxy ¶
GetRandomProxy returns a random *url.URL for usage with own http.Client