Documentation
¶
Index ¶
- Variables
- type Client
- func (c *Client) GetCities(ctx context.Context, countryCode, isp, regionID string) ([]string, error)
- func (c *Client) GetMobileISPs(ctx context.Context, countryCode, regionID, cityID string) ([]string, error)
- func (c *Client) GetRegions(ctx context.Context, countryCode, isp string) ([]string, error)
- func (c *Client) GetResidentialISPs(ctx context.Context, countryCode, regionID, cityID string) ([]string, error)
- type ConnType
- type ProxyAuthConfig
- type ProxyNodeConfig
- type ProxySession
- type ProxySessionConfig
- type SessionConfig
Constants ¶
This section is empty.
Variables ¶
var SessionNotPersistent = SessionConfig{Duration: -1}
Indicates that the session should not persist. No session ID will be set and each request will get a different node.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
APIKey string
PackageKey string
// ConnType is the connection type.
ConnType ConnType
// HTTPClient is the client to use for API calls. If nil, a default client will be used.
HTTPClient *http.Client
// BaseURL for testing. If empty, "https://api.soax.com" is used. This can be a plain URL, or one
// with a path.
BaseURL string
}
Client allows you to access the SOAX REST API.
func (*Client) GetCities ¶
func (c *Client) GetCities(ctx context.Context, countryCode, isp, regionID string) ([]string, error)
GetCities returns the available cities for the given country, ISP, and region. API reference: https://helpcenter.soax.com/en/articles/6228092-getting-a-list-of-cities
func (*Client) GetMobileISPs ¶
func (c *Client) GetMobileISPs(ctx context.Context, countryCode, regionID, cityID string) ([]string, error)
GetMobileISPs returns the available mobile carriers for the given location. This is for Mobile packages only. API reference: https://helpcenter.soax.com/en/articles/6228381-getting-a-list-of-mobile-carriers
func (*Client) GetRegions ¶
GetRegions returns the available regions for the given country and ISP. API reference: https://helpcenter.soax.com/en/articles/6227864-getting-a-list-of-regions
func (*Client) GetResidentialISPs ¶
func (c *Client) GetResidentialISPs(ctx context.Context, countryCode, regionID, cityID string) ([]string, error)
GetResidentialISPs returns the available ISPs for the given location. This is for Residential packages only. The official documentation refers to them as "WiFi ISPS". API reference: https://helpcenter.soax.com/en/articles/6228391-getting-a-list-of-wifi-isps
type ProxyAuthConfig ¶
ProxyAuthConfig represents the authentication credentials for the SOAX proxy.
type ProxyNodeConfig ¶
ProxyNodeConfig defines the geographic and network restrictions for the proxy node.
type ProxySession ¶
type ProxySession struct {
// contains filtered or unexported fields
}
ProxySession represents a session with unique SessionID, created from a SessionConfig.
func (*ProxySession) NewSOCKS5Client ¶
func (c *ProxySession) NewSOCKS5Client() (*socks5.Client, error)
NewSOCKS5Client creates a socks5.Client that connects through the SOAX proxy.
func (*ProxySession) NewWebProxyStreamDialer ¶
func (c *ProxySession) NewWebProxyStreamDialer() (transport.StreamDialer, error)
NewStreamDialer creates a transport.StreamDialer that connects through the SOAX proxy. It uses HTTP CONNECT, so it only supports TCP.
type ProxySessionConfig ¶
type ProxySessionConfig struct {
// Authentication credentials
Auth ProxyAuthConfig
// Node restrictions
Node ProxyNodeConfig
// Session management
// Set to SessionNotPersistent to disable session persistence and get different nodes per request.
Session SessionConfig
// Endpoint address. If empty, defaults to proxy.soax.com:5000.
// Useful for testing or reverse proxies.
Endpoint string
}
ProxySessionConfig defines how to connect to the SOAX proxy.
func (*ProxySessionConfig) NewSession ¶
func (c *ProxySessionConfig) NewSession() *ProxySession
type SessionConfig ¶
type SessionConfig struct {
// Unique ID for this session
ID string
// How long this session should last
Duration time.Duration
// Rotate the node if the session goes idle for longer than this.
IdleTTL time.Duration
}
SessionConfig defines the session management parameters for the proxy.