Documentation
¶
Index ¶
- Constants
- Variables
- func MakeAuthHash(secret string) (string, int64)
- type BestLocation
- type BestLocationResponse
- type RegisterTokenRequest
- type RegisterTokenResponse
- type ServerCredentialsResponse
- type ServerList
- type ServerListGroup
- type ServerListGroupHost
- type ServerListLocation
- type ServerListResponse
- type SessionResponse
- type StrKV
- type UsersRequest
- type UsersResponse
- type WndClient
- func (c *WndClient) BestLocation(ctx context.Context) (*BestLocation, error)
- func (c *WndClient) GetProxyCredentials() (string, string)
- func (c *WndClient) ServerCredentials(ctx context.Context) error
- func (c *WndClient) ServerList(ctx context.Context) (ServerList, error)
- func (c *WndClient) Session(ctx context.Context, username, password, tfacode string) error
- type WndClientState
- type WndEndpoints
- type WndSettings
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 DefaultWndEndpoints = WndEndpoints{
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 DefaultWndSettings = WndSettings{ 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: DefaultWndEndpoints, }
View Source
var ErrNoDataInResponse = errors.New("no \"data\" key in response")
Functions ¶
func MakeAuthHash ¶
Types ¶
type BestLocation ¶ added in v1.0.0
type BestLocationResponse ¶ added in v1.0.0
type BestLocationResponse struct {
Data *BestLocation `json:"data"`
}
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 ¶ added in v1.1.0
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 ¶
type UsersResponse ¶
type WndClient ¶
type WndClient struct { Mux sync.Mutex State WndClientState // contains filtered or unexported fields }
func NewWndClient ¶
func NewWndClient(transport http.RoundTripper) (*WndClient, error)
func (*WndClient) BestLocation ¶ added in v1.0.0
func (c *WndClient) BestLocation(ctx context.Context) (*BestLocation, error)
func (*WndClient) GetProxyCredentials ¶
func (*WndClient) ServerCredentials ¶
func (*WndClient) ServerList ¶
func (c *WndClient) ServerList(ctx context.Context) (ServerList, error)
type WndClientState ¶
type WndClientState 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 WndSettings `json:"settings"` }
type WndEndpoints ¶
type WndSettings ¶
Click to show internal directories.
Click to hide internal directories.