Help us shape the future of Go! Take the 2026 Go Developer Survey

seclient

package
v1.30.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 20, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Index

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,
}

Functions

This section is empty.

Types

type APIError added in v1.18.0

type APIError struct {
	Code    int64
	Message string
}

func (*APIError) Error added in v1.18.0

func (e *APIError) Error() string

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)

NewSEClient instantiates a SurfEasy client. apiUsername/apiSecret are the application-level Digest Auth credentials embedded in every Opera client — they are NOT per-user and must not be randomised. transport may be nil (uses http.DefaultTransport).

func (*SEClient) AnonRegister

func (c *SEClient) AnonRegister(ctx context.Context) error

func (*SEClient) DeviceGeneratePassword

func (c *SEClient) DeviceGeneratePassword(ctx context.Context) error

func (*SEClient) Discover

func (c *SEClient) Discover(ctx context.Context, requestedGeo string) ([]SEIPEntry, error)

func (*SEClient) GeoList

func (c *SEClient) GeoList(ctx context.Context) ([]SEGeoEntry, error)

func (*SEClient) GetProxyCredentials

func (c *SEClient) GetProxyCredentials() (string, string)

func (*SEClient) Login

func (c *SEClient) Login(ctx context.Context) error

func (*SEClient) Register

func (c *SEClient) Register(ctx context.Context) error

func (*SEClient) RegisterDevice

func (c *SEClient) RegisterDevice(ctx context.Context) error

func (*SEClient) ResetCookies

func (c *SEClient) ResetCookies() error

func (*SEClient) RpcCall

func (c *SEClient) RpcCall(ctx context.Context, endpoint string, params map[string]string, res interface{}) error

type SEDeviceGeneratePasswordData

type SEDeviceGeneratePasswordData struct {
	DevicePassword string `json:"device_password"`
}

type SEDeviceGeneratePasswordResponse

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 SEEndpoints struct {
	RegisterSubscriber     string
	SubscriberLogin        string
	RegisterDevice         string
	DeviceGeneratePassword string
	GeoList                string
	Discover               string
}

type SEGeoEntry

type SEGeoEntry struct {
	Country     string `json:"country,omitempty"`
	CountryCode string `json:"country_code"`
}

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"`
	Host  string     `json:"host,omitempty"`
	IP    string     `json:"ip"`
	Ports []uint16   `json:"ports"`
}

func (*SEIPEntry) NetAddr

func (e *SEIPEntry) NetAddr() string

func (SEIPEntry) String

func (e SEIPEntry) String() string

type SERegisterDeviceData

type SERegisterDeviceData struct {
	ClientType     string `json:"client_type"`
	DeviceID       string `json:"device_id"`
	DevicePassword string `json:"device_password"`
}

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 SESettings struct {
	ClientVersion   string
	ClientType      string
	DeviceName      string
	OperatingSystem string
	UserAgent       string
	Endpoints       SEEndpoints
}

type SEStatusPair

type SEStatusPair struct {
	Code    int64
	Message string
}

func (*SEStatusPair) UnmarshalJSON

func (p *SEStatusPair) UnmarshalJSON(b []byte) error

type SESubscriberLoginResponse

type SESubscriberLoginResponse SERegisterSubscriberResponse

type StdJar

type StdJar struct {
	// contains filtered or unexported fields
}

func NewStdJar

func NewStdJar() (*StdJar, error)

func (*StdJar) Cookies

func (j *StdJar) Cookies(u *url.URL) []*http.Cookie

func (*StdJar) Reset

func (j *StdJar) Reset() error

func (*StdJar) SetCookies

func (j *StdJar) SetCookies(u *url.URL, cookies []*http.Cookie)

SetCookies writes cookies into the jar. Must use Lock (not RLock): cookiejar.Jar.SetCookies mutates internal state and is not safe for concurrent use with any other Jar method.

type StrKV

type StrKV map[string]string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL