Documentation
¶
Index ¶
- Constants
- Variables
- type SEClient
- func (c *SEClient) AnonRegister(ctx context.Context) error
- func (c *SEClient) DeviceGeneratePassword(ctx context.Context) error
- func (c *SEClient) Discover(ctx context.Context, requestedGeo string) ([]SEIPEntry, error)
- func (c *SEClient) GeoList(ctx context.Context) ([]SEGeoEntry, error)
- func (c *SEClient) GetProxyCredentials() (string, string)
- func (c *SEClient) Login(ctx context.Context) error
- func (c *SEClient) Register(ctx context.Context) error
- func (c *SEClient) RegisterDevice(ctx context.Context) error
- func (c *SEClient) ResetCookies() error
- func (c *SEClient) RpcCall(ctx context.Context, endpoint string, params map[string]string, ...) error
- type SEDeviceGeneratePasswordData
- type SEDeviceGeneratePasswordResponse
- type SEDiscoverResponse
- type SEEndpoints
- type SEGeoEntry
- type SEGeoListResponse
- type SEIPEntry
- type SERegisterDeviceData
- type SERegisterDeviceResponse
- type SERegisterSubscriberResponse
- type SESettings
- type SEStatusPair
- type SESubscriberLoginResponse
- type StdJar
- type StrKV
Constants ¶
View Source
const ( ANON_EMAIL_LOCALPART_BYTES = 32 ANON_PASSWORD_BYTES = 20 DEVICE_ID_BYTES = 20 READ_LIMIT int64 = 128 * 1024 )
View Source
const (
SE_STATUS_OK int64 = 0
)
Variables ¶
View Source
var DefaultSEEndpoints = SEEndpoints{
RegisterSubscriber: "https://api2.sec-tunnel.com/v4/register_subscriber",
SubscriberLogin: "https://api2.sec-tunnel.com/v4/subscriber_login",
RegisterDevice: "https://api2.sec-tunnel.com/v4/register_device",
DeviceGeneratePassword: "https://api2.sec-tunnel.com/v4/device_generate_password",
GeoList: "https://api2.sec-tunnel.com/v4/geo_list",
Discover: "https://api2.sec-tunnel.com/v4/discover",
}
View Source
var DefaultSESettings = SESettings{ ClientVersion: "Stable 114.0.5282.21", ClientType: "se0316", UserAgent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36 OPR/114.0.0.0", DeviceName: "Opera-Browser-Client", OperatingSystem: "Windows", Endpoints: DefaultSEEndpoints, }
View Source
var RandomSource secureRandomSource
Functions ¶
This section is empty.
Types ¶
type SEClient ¶
type SEClient struct { Settings SESettings SubscriberEmail string SubscriberPassword string DeviceID string AssignedDeviceID string AssignedDeviceIDHash string DevicePassword string Mux sync.Mutex // contains filtered or unexported fields }
func NewSEClient ¶
func NewSEClient(apiUsername, apiSecret string, transport http.RoundTripper) (*SEClient, error)
Instantiates SurfEasy client with default settings and given API keys. Optional `transport` parameter allows to override HTTP transport used for HTTP calls
func (*SEClient) DeviceGeneratePassword ¶ added in v1.2.0
func (*SEClient) GetProxyCredentials ¶
func (*SEClient) ResetCookies ¶ added in v1.2.0
type SEDeviceGeneratePasswordData ¶ added in v1.2.0
type SEDeviceGeneratePasswordData struct {
DevicePassword string `json:"device_password"`
}
type SEDeviceGeneratePasswordResponse ¶ added in v1.2.0
type SEDeviceGeneratePasswordResponse struct { Data SEDeviceGeneratePasswordData `json:"data"` Status SEStatusPair `json:"return_code"` }
type SEDiscoverResponse ¶
type SEDiscoverResponse struct { Data struct { IPs []SEIPEntry `json:"ips"` } `json:"data"` Status SEStatusPair `json:"return_code"` }
type SEEndpoints ¶
type SEGeoEntry ¶
type SEGeoListResponse ¶
type SEGeoListResponse struct { Data struct { Geos []SEGeoEntry `json:"geos"` } `json:"data"` Status SEStatusPair `json:"return_code"` }
type SEIPEntry ¶
type SEIPEntry struct { Geo SEGeoEntry `json:"geo"` IP string `json:"ip"` Ports []uint16 `json:"ports"` }
type SERegisterDeviceData ¶
type SERegisterDeviceResponse ¶
type SERegisterDeviceResponse struct { Data SERegisterDeviceData `json:"data"` Status SEStatusPair `json:"return_code"` }
type SERegisterSubscriberResponse ¶
type SERegisterSubscriberResponse struct { Data interface{} `json:"data"` Status SEStatusPair `json:"return_code"` }
type SESettings ¶
type SEStatusPair ¶
func (*SEStatusPair) UnmarshalJSON ¶
func (p *SEStatusPair) UnmarshalJSON(b []byte) error
type SESubscriberLoginResponse ¶ added in v1.2.0
type SESubscriberLoginResponse SERegisterSubscriberResponse
Click to show internal directories.
Click to hide internal directories.