Documentation ¶
Index ¶
- Constants
- Variables
- func MakeAuthHash(secret string) (string, int64)
- type BestLocation
- type BestLocationResponse
- type Client
- func (c *Client) BestLocation(ctx context.Context) (*BestLocation, error)
- func (c *Client) GetProxyCredentials() (string, string)
- func (c *Client) ServerCredentials(ctx context.Context) error
- func (c *Client) ServerList(ctx context.Context) (ServerList, error)
- func (c *Client) Session(ctx context.Context, username, password, tfacode string) error
- type ClientState
- type Endpoints
- type RegisterTokenRequest
- type RegisterTokenResponse
- type ServerCredentialsResponse
- type ServerList
- type ServerListGroup
- type ServerListGroupHost
- type ServerListLocation
- type ServerListResponse
- type SessionResponse
- type Settings
- type StrKV
- type UsersRequest
- type UsersResponse
Constants ¶
View Source
const ( READ_LIMIT int64 = 128 * 1024 SESSION_TYPE_WEB = 1 SESSION_TYPE_EXT = 2 SESSION_TYPE_DESKTOP = 3 SESSION_TYPE_MOBILE = 4 ACCOUNT_STATE_ACTIVE = 1 ACCOUNT_STATE_OUT_OF_DATA = 2 ACCOUNT_STATE_BANNED = 3 )
Variables ¶
View Source
var DefaultEndpoints = Endpoints{
Session: "https://api.windscribe.com/Session",
ServerList: "https://assets.windscribe.com/serverlist",
ServerCredentials: "https://api.windscribe.com/ServerCredentials",
BestLocation: "https://api.windscribe.com/BestLocation",
}
View Source
var DefaultSettings = Settings{ ClientAuthSecret: "952b4412f002315aa50751032fcaab03", Platform: "chrome", Type: "chrome", UserAgent: "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.5060.53 Safari/537.36", Origin: "chrome-extension://hnmpcagpplmpfojmgmnngilcnanddlhb", SessionType: SESSION_TYPE_EXT, Endpoints: DefaultEndpoints, }
View Source
var ErrNoDataInResponse = errors.New("no \"data\" key in response")
Functions ¶
func MakeAuthHash ¶
Types ¶
type BestLocation ¶
type BestLocationResponse ¶
type BestLocationResponse struct {
Data *BestLocation `json:"data"`
}
type Client ¶
type Client struct { Mux sync.Mutex State ClientState // contains filtered or unexported fields }
func (*Client) BestLocation ¶
func (c *Client) BestLocation(ctx context.Context) (*BestLocation, error)
func (*Client) GetProxyCredentials ¶
func (*Client) ServerList ¶
func (c *Client) ServerList(ctx context.Context) (ServerList, error)
type ClientState ¶
type ClientState struct { TokenID string `json:"token_id"` Token string `json:"token"` TokenSignature string `json:"token_signature"` TokenSignatureTime int64 `json:"token_signature_time,string"` LocationHash string `json:"loc_hash"` LocationRevision int `json:"loc_rev"` IsPremium bool `json:"is_premium"` Status int `json:"status"` UserID string `json:"user_id"` SessionAuthHash string `json:"session_auth_hash"` ProxyUsername string `json:"proxy_username"` ProxyPassword string `json:"proxy_password"` Settings Settings `json:"settings"` }
type RegisterTokenRequest ¶
type RegisterTokenResponse ¶
type ServerList ¶
type ServerList []ServerListLocation
type ServerListGroup ¶
type ServerListGroupHost ¶
type ServerListLocation ¶
type ServerListLocation struct { ID int `json:"id"` Name string `json:"name"` CountryCode string `json:"country_code"` Status int `json:"status"` PremiumOnly int `json:"premium_only"` ShortName string `json:"short_name"` P2P int `json:"p2p"` TZName string `json:"tz"` TZOffset string `json:"tz_offset"` LocationType string `json:"loc_type"` ForceExpand int `json:"force_expand"` Groups []ServerListGroup `json:"groups"` }
type ServerListResponse ¶
type ServerListResponse struct { Data ServerList `json:"data"` Info *struct { Revision int `json:"revision"` RevisionHash string `json:"revision_hash"` Changed int `json:"changed"` FC int `json:"fc"` ProDatacenters []interface{} } `json:"info"` }
type SessionResponse ¶
type SessionResponse struct { Data *struct { SessionAuthHash string `json:"session_auth_hash"` Username string `json:"username"` UserID string `json:"user_id"` TrafficUsed float64 `json:"traffic_used"` TrafficMax float64 `json:"traffic_max"` Status int `json:"status"` Email *string `json:"email"` EmailStatus int `json:"email_status"` BillingPlanID int64 `json:"billing_plan_id"` IsPremium int `json:"is_premium"` RegDate float64 `json:"reg_date"` LocationRevision int `json:"loc_rev"` LocationHash string `json:"loc_hash"` } `json:"data"` }
type UsersRequest ¶
Click to show internal directories.
Click to hide internal directories.