arn-browser 0.0.3 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/README.md +3 -2
  2. package/package.json +28 -49
  3. package/rowser_automation_env.js +32 -0
  4. package/src/all_routes/routeWithSuperagent.d.ts +67 -0
  5. package/src/all_routes/routeWithSuperagent.js +322 -0
  6. package/src/index.d.ts +19 -0
  7. package/src/index.js +15 -0
  8. package/src/others/totp-generator.d.ts +15 -0
  9. package/src/others/totp-generator.js +86 -0
  10. package/src/utility/deleteDirectory.js +105 -0
  11. package/src/utility/launchBrowser.d.ts +221 -0
  12. package/src/utility/launchBrowser.js +868 -0
  13. package/src/utility/multilogin_token_manager.js +186 -0
  14. package/src/utility/playwright-helper.d.ts +61 -0
  15. package/src/utility/playwright-helper.js +129 -0
  16. package/src/utility/proxy-utility/custom-proxy.d.ts +93 -0
  17. package/src/utility/proxy-utility/custom-proxy.js +669 -0
  18. package/src/utility/proxy-utility/proxy-chain.d.ts +123 -0
  19. package/src/utility/proxy-utility/proxy-chain.js +337 -0
  20. package/src/utility/proxy-utility/proxy-helper.d.ts +91 -0
  21. package/src/utility/proxy-utility/proxy-helper.js +245 -0
  22. package/dist/__main__.d.ts +0 -2
  23. package/dist/__main__.js +0 -127
  24. package/dist/__version__.d.ts +0 -11
  25. package/dist/__version__.js +0 -16
  26. package/dist/addons.d.ts +0 -17
  27. package/dist/addons.js +0 -70
  28. package/dist/data-files/territoryInfo.xml +0 -2024
  29. package/dist/data-files/webgl_data.db +0 -0
  30. package/dist/exceptions.d.ts +0 -76
  31. package/dist/exceptions.js +0 -153
  32. package/dist/fingerprints.d.ts +0 -4
  33. package/dist/fingerprints.js +0 -82
  34. package/dist/index.d.ts +0 -3
  35. package/dist/index.js +0 -3
  36. package/dist/ip.d.ts +0 -25
  37. package/dist/ip.js +0 -90
  38. package/dist/locale.d.ts +0 -26
  39. package/dist/locale.js +0 -280
  40. package/dist/mappings/browserforge.config.d.ts +0 -47
  41. package/dist/mappings/browserforge.config.js +0 -72
  42. package/dist/mappings/fonts.config.d.ts +0 -6
  43. package/dist/mappings/fonts.config.js +0 -822
  44. package/dist/mappings/warnings.config.d.ts +0 -16
  45. package/dist/mappings/warnings.config.js +0 -28
  46. package/dist/pkgman.d.ts +0 -62
  47. package/dist/pkgman.js +0 -347
  48. package/dist/server.d.ts +0 -6
  49. package/dist/server.js +0 -9
  50. package/dist/sync_api.d.ts +0 -7
  51. package/dist/sync_api.js +0 -27
  52. package/dist/utils.d.ts +0 -88
  53. package/dist/utils.js +0 -500
  54. package/dist/virtdisplay.d.ts +0 -20
  55. package/dist/virtdisplay.js +0 -123
  56. package/dist/warnings.d.ts +0 -4
  57. package/dist/warnings.js +0 -30
  58. package/dist/webgl/db-compat.d.ts +0 -9
  59. package/dist/webgl/db-compat.js +0 -44
  60. package/dist/webgl/sample.d.ts +0 -19
  61. package/dist/webgl/sample.js +0 -85
  62. /package/{LICENSE.md → LICENSE} +0 -0
@@ -0,0 +1,123 @@
1
+ // ============================================================================
2
+ // PROXY CHAIN UTILITIES (UPDATED)
3
+ // ============================================================================
4
+
5
+ export interface ProxyConfig {
6
+ type: "http" | "https" | "socks5" | "socks" | "socks4";
7
+ host: string;
8
+ port: number | string;
9
+ user?: string;
10
+ pass?: string;
11
+ }
12
+
13
+ /**
14
+ * Geo-IP details fetched for a specific proxy connection.
15
+ */
16
+ export interface GeoDetails {
17
+ /** The Public IP address */
18
+ ip: string;
19
+ /** Country name (e.g., "United States") */
20
+ country: string;
21
+ /** City name (e.g., "New York") */
22
+ city: string;
23
+ /** Timezone ID (e.g., "America/New_York"). Returns null if lookup failed. */
24
+ timezoneId: string | null;
25
+ }
26
+
27
+ /**
28
+ * Statistics for data transfer.
29
+ */
30
+ export interface TrafficStats {
31
+ /** Number of requests handled */
32
+ req: number;
33
+ /** Data sent to client (Formatted MB string) */
34
+ Tx: string;
35
+ /** Data received from client (Formatted MB string) */
36
+ Rx: string;
37
+ }
38
+
39
+ /**
40
+ * Configuration options for starting the Proxy Chain Server.
41
+ */
42
+ export interface ProxyServerOptions {
43
+ /** Configuration for the default upstream proxy */
44
+ DEFAULT_DATA?: ProxyConfig;
45
+ /** Configuration for the first specific upstream proxy */
46
+ PROXY_1_DATA?: ProxyConfig;
47
+ /** Configuration for the second specific upstream proxy */
48
+ PROXY_2_DATA?: ProxyConfig;
49
+
50
+ /** Hostnames (wildcards supported) to route through PROXY_1 */
51
+ PROXY_1_HOSTS?: string[];
52
+ /** Hostnames (wildcards supported) to route through PROXY_2 */
53
+ PROXY_2_HOSTS?: string[];
54
+ /** Hostnames to bypass the proxy entirely (Direct connection) */
55
+ NO_PROXY_HOSTS?: string[];
56
+
57
+ /** * API Key for IP2Location.io.
58
+ * - If provided: Uses IP2Location (HTTPS, highly accurate).
59
+ * - If omitted: Falls back to Keyless IP2Location or ip-api.com.
60
+ */
61
+ ip2LocationKey?: string;
62
+
63
+ /** Enable verbose logging (default: false) */
64
+ debug?: boolean;
65
+ /** Track proxy usage statistics (default: true) */
66
+ proxy_stats?: boolean;
67
+ }
68
+
69
+ /**
70
+ * The controller object returned by startProxyServer.
71
+ */
72
+ export interface ProxyServerController {
73
+ /** The local port the proxy server is listening on */
74
+ port: number;
75
+ /** The full local proxy URL (e.g., http://127.0.0.1:50001) */
76
+ proxyUrl: string;
77
+
78
+ // --- Detailed Information ---
79
+
80
+ /** * Full Geo-IP details for configured channels.
81
+ * Returns null if the channel was not configured or the connection failed.
82
+ */
83
+ details: {
84
+ default: GeoDetails | null;
85
+ proxy1: GeoDetails | null;
86
+ proxy2: GeoDetails | null;
87
+ };
88
+
89
+ // --- Convenience Fields for Playwright ---
90
+
91
+ /** The detected Timezone ID for the Default Proxy (e.g., "Europe/Berlin") or null */
92
+ DEFAULT_PROXY_TIMEZONE: string | null;
93
+ /** The detected Timezone ID for Proxy 1 or null */
94
+ PROXY_1_TIMEZONE: string | null;
95
+ /** The detected Timezone ID for Proxy 2 or null */
96
+ PROXY_2_TIMEZONE: string | null;
97
+
98
+ /** The public IP of the default upstream proxy */
99
+ DEFAULT_PROXY_IP: string | null;
100
+ /** The public IP of Proxy 1 */
101
+ PROXY_1_IP: string | null;
102
+ /** The public IP of Proxy 2 */
103
+ PROXY_2_IP: string | null;
104
+
105
+ /** Gracefully closes the proxy server */
106
+ closeServer: () => Promise<void>;
107
+
108
+ /** Returns formatted statistics for all proxy channels */
109
+ getProxyStats: () => Record<string, TrafficStats>;
110
+ }
111
+
112
+ /**
113
+ * Starts a local proxy server that routes requests to different upstream proxies.
114
+ * Automatically fetches IP and Timezone details for configured proxies.
115
+ */
116
+ export function startProxyServer(options: ProxyServerOptions): Promise<ProxyServerController | null>;
117
+
118
+ /**
119
+ * Fetches the public IP address and Timezone ID via a specific proxy URL.
120
+ * * @param proxyUrl The proxy URL string (e.g., "http://user:pass@host:port"). Pass `null` to test the Local/Direct connection.
121
+ * @returns A promise resolving to GeoDetails (including timezoneId) or null if unreachable.
122
+ */
123
+ export function fetchPublicIP(proxyUrl: string | null): Promise<GeoDetails | null>;
@@ -0,0 +1,337 @@
1
+ import ProxyChain from "proxy-chain";
2
+ import net from "net";
3
+ import https from "https";
4
+ import http from "http";
5
+ import { HttpsProxyAgent } from "https-proxy-agent";
6
+ import { SocksProxyAgent } from "socks-proxy-agent";
7
+
8
+ // ==========================================
9
+ // SECTION 1: NETWORK HELPERS
10
+ // ==========================================
11
+
12
+ function nativeGet(url, agent = null, timeout = 5000) {
13
+ return new Promise((resolve, reject) => {
14
+ const urlObj = new URL(url);
15
+ const requestModule = urlObj.protocol === "https:" ? https : http;
16
+
17
+ const options = {
18
+ agent: agent,
19
+ timeout: timeout,
20
+ headers: { "User-Agent": "Mozilla/5.0 (Node.js Proxy Checker)" },
21
+ };
22
+
23
+ const req = requestModule.get(url, options, (res) => {
24
+ if (res.statusCode < 200 || res.statusCode >= 300) {
25
+ res.resume();
26
+ return reject(new Error(`Status Code: ${res.statusCode}`));
27
+ }
28
+ let data = "";
29
+ res.setEncoding("utf8");
30
+ res.on("data", (chunk) => {
31
+ data += chunk;
32
+ });
33
+ res.on("end", () => resolve(data));
34
+ });
35
+
36
+ req.on("error", (err) => reject(err));
37
+ req.on("timeout", () => {
38
+ req.destroy();
39
+ reject(new Error("Request Timed Out"));
40
+ });
41
+ });
42
+ }
43
+
44
+ const isPortAvailable = (port) => {
45
+ return new Promise((resolve) => {
46
+ const server = net.createServer();
47
+ server.once("error", () => resolve(false));
48
+ server.once("listening", () => {
49
+ server.close();
50
+ resolve(true);
51
+ });
52
+ server.listen(port);
53
+ });
54
+ };
55
+
56
+ const findAvailablePort = async (startPort, endPort) => {
57
+ for (let port = startPort; port <= endPort; port++) {
58
+ if (await isPortAvailable(port)) return port;
59
+ }
60
+ return null;
61
+ };
62
+
63
+ // ==========================================
64
+ // SECTION 2: HOST MATCHERS
65
+ // ==========================================
66
+
67
+ const createHostMatcher = (hostList) => {
68
+ const exactMatches = new Set();
69
+ const regexMatches = [];
70
+
71
+ hostList.forEach((host) => {
72
+ if (!host) return;
73
+ if (host.includes("%")) {
74
+ const cleanPattern = host.replace(/%/g, "").replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
75
+ regexMatches.push(new RegExp(cleanPattern, "i"));
76
+ } else {
77
+ exactMatches.add(host.toLowerCase());
78
+ }
79
+ });
80
+
81
+ return (hostname) => {
82
+ if (!hostname) return false;
83
+ const lowerHost = hostname.toLowerCase();
84
+ if (exactMatches.has(lowerHost)) return true;
85
+ return regexMatches.some((rx) => rx.test(lowerHost));
86
+ };
87
+ };
88
+
89
+ // ==========================================
90
+ // SECTION 3: SIMPLIFIED IP FETCHING
91
+ // ==========================================
92
+
93
+ export async function fetchPublicIP(proxyUrl) {
94
+ const details = await fetchProxyDetails(proxyUrl);
95
+ return details;
96
+ }
97
+
98
+ /**
99
+ * LOGIC:
100
+ * 1. If proxyUrl is provided -> Fetch Real Data (IP + Timezone).
101
+ * 2. If proxyUrl is NULL/Undefined -> Return "Local" Mock immediately.
102
+ */
103
+ export async function fetchProxyDetails(proxyUrl, apiKey = null) {
104
+ // --- AUTOMATIC LOCAL FALLBACK ---
105
+ if (!proxyUrl) {
106
+ return {
107
+ ip: "127.0.0.1",
108
+ country: "Local",
109
+ city: "Local",
110
+ timezoneId: null, // Playwright will use system time
111
+ };
112
+ }
113
+
114
+ // --- EXTERNAL LOOKUP (Only if proxy exists) ---
115
+ const attempts = ["IP-API", "IP2Location"];
116
+
117
+ for (const provider of attempts) {
118
+ try {
119
+ const isSocks = proxyUrl.startsWith("socks");
120
+ const agent = isSocks ? new SocksProxyAgent(proxyUrl) : new HttpsProxyAgent(proxyUrl);
121
+
122
+ let apiUrl;
123
+
124
+ if (provider === "IP-API") {
125
+ apiUrl = "http://ip-api.com/json/?fields=status,message,country,city,timezone,query";
126
+ } else {
127
+ const baseUrl = "https://api.ip2location.io/";
128
+ const fields = "ip,country_name,city_name,time_zone,time_zone_olson";
129
+ apiUrl = apiKey
130
+ ? `${baseUrl}?key=${apiKey}&format=json&fields=${fields}`
131
+ : `${baseUrl}?format=json&fields=${fields}`;
132
+ }
133
+
134
+ const jsonStr = await nativeGet(apiUrl, agent, 6000);
135
+ const data = JSON.parse(jsonStr);
136
+
137
+ if (provider === "IP-API") {
138
+ if (data.status === "success") {
139
+ return {
140
+ ip: data.query,
141
+ country: data.country,
142
+ city: data.city,
143
+ timezoneId: data.timezone || null,
144
+ };
145
+ }
146
+ } else if (provider === "IP2Location") {
147
+ if (data && data.ip) {
148
+ const tz = data.time_zone_olson || null;
149
+ const isValidId = tz && !tz.startsWith("+") && !tz.startsWith("-");
150
+ return {
151
+ ip: data.ip,
152
+ country: data.country_name,
153
+ city: data.city_name,
154
+ timezoneId: isValidId ? tz : null,
155
+ };
156
+ }
157
+ }
158
+ } catch (err) {
159
+ // Silently fail to next provider
160
+ }
161
+ }
162
+
163
+ // If proxy was provided but failed to connect:
164
+ return null;
165
+ }
166
+
167
+ // ==========================================
168
+ // SECTION 4: MAIN PROXY SERVER
169
+ // ==========================================
170
+
171
+ export async function startProxyServer({
172
+ DEFAULT_DATA,
173
+ PROXY_1_DATA,
174
+ PROXY_2_DATA,
175
+ PROXY_1_HOSTS = [],
176
+ PROXY_2_HOSTS = [],
177
+ NO_PROXY_HOSTS = [],
178
+ ip2LocationKey = null,
179
+ debug = false,
180
+ proxy_stats = true,
181
+ }) {
182
+ // 1. Matchers
183
+ const matchers = {
184
+ noProxy: createHostMatcher([...NO_PROXY_HOSTS, "brave.com", "gvt1.com"]),
185
+ proxy1: createHostMatcher([...PROXY_1_HOSTS, "proxy.multilogin.com", "multilogin.com"]),
186
+ proxy2: createHostMatcher([...PROXY_2_HOSTS, "proxy.multilogin.com", "multilogin.com"]),
187
+ };
188
+
189
+ // 2. Port
190
+ const selectedPort = await findAvailablePort(50001, 50010);
191
+ if (!selectedPort) {
192
+ console.error("❌ Critical Error: No available ports.");
193
+ return null;
194
+ }
195
+
196
+ // 3. Build URLs
197
+ const buildURL = (data) => {
198
+ if (!data) return null; // Returns null if no config
199
+ const { type = "http", host, port, user, pass } = data;
200
+ const protocol = type.toLowerCase().startsWith("socks") ? "socks" : "http";
201
+ const auth = user && pass ? `${user}:${pass}@` : "";
202
+ return `${protocol}://${auth}${host}:${port}`;
203
+ };
204
+
205
+ const upstreamProxies = {
206
+ default: buildURL(DEFAULT_DATA),
207
+ p1: buildURL(PROXY_1_DATA),
208
+ p2: buildURL(PROXY_2_DATA),
209
+ };
210
+
211
+ // 4. Fetch Details (Simplified Logic)
212
+ // We pass the URL (or null). The function handles the "Local" logic.
213
+ const [defaultDetails, p1Details, p2Details] = await Promise.all([
214
+ fetchProxyDetails(upstreamProxies.default, ip2LocationKey),
215
+ fetchProxyDetails(upstreamProxies.p1, ip2LocationKey),
216
+ fetchProxyDetails(upstreamProxies.p2, ip2LocationKey),
217
+ ]);
218
+
219
+ // Warn only if proxy was configured (URL exists) but details came back null (Connection failed)
220
+ if (upstreamProxies.p1 && !p1Details) console.warn("⚠️ Warning: PROXY_1 configured but unreachable.");
221
+ if (upstreamProxies.p2 && !p2Details) console.warn("⚠️ Warning: PROXY_2 configured but unreachable.");
222
+
223
+ // 5. Stats
224
+ const stats = {
225
+ DEFAULT_PROXY: { request: 0, Tx: 0, Rx: 0 },
226
+ NO_PROXY: { request: 0, Tx: 0, Rx: 0 },
227
+ PROXY_1: { request: 0, Tx: 0, Rx: 0 },
228
+ PROXY_2: { request: 0, Tx: 0, Rx: 0 },
229
+ };
230
+ const connectionMap = {};
231
+
232
+ // 6. Server
233
+ const server = new ProxyChain.Server({
234
+ port: selectedPort,
235
+ host: "127.0.0.1",
236
+ verbose: debug,
237
+ prepareRequestFunction: ({ hostname, connectionId }) => {
238
+ // A. Direct (Force NO_PROXY)
239
+ if (matchers.noProxy(hostname)) {
240
+ connectionMap[connectionId] = { type: "NO_PROXY" };
241
+ return { upstreamProxyUrl: null, requestAuthentication: false };
242
+ }
243
+
244
+ // B. IP Check Interception (ip.bablosoft.com)
245
+ if (hostname === "ip.bablosoft.com") {
246
+ let displayedIP;
247
+
248
+ if (matchers.proxy1(hostname)) displayedIP = p1Details?.ip;
249
+ else if (matchers.proxy2(hostname)) displayedIP = p2Details?.ip;
250
+ else displayedIP = defaultDetails?.ip; // Uses Default (or Local fallback)
251
+
252
+ return {
253
+ customResponseFunction: () => ({
254
+ statusCode: 200,
255
+ headers: { "Content-Type": "text/plain", Connection: "close" },
256
+ body: displayedIP || "Unknown IP",
257
+ }),
258
+ };
259
+ }
260
+
261
+ // C. Routing
262
+ if (matchers.proxy1(hostname) && upstreamProxies.p1) {
263
+ connectionMap[connectionId] = { type: "PROXY_1" };
264
+ return { upstreamProxyUrl: upstreamProxies.p1 };
265
+ }
266
+ if (matchers.proxy2(hostname) && upstreamProxies.p2) {
267
+ connectionMap[connectionId] = { type: "PROXY_2" };
268
+ return { upstreamProxyUrl: upstreamProxies.p2 };
269
+ }
270
+
271
+ // D. Default
272
+ connectionMap[connectionId] = { type: "DEFAULT_PROXY" };
273
+ return { upstreamProxyUrl: upstreamProxies.default };
274
+ },
275
+ });
276
+
277
+ server.on("connectionClosed", ({ connectionId, stats: connStats }) => {
278
+ const connectionInfo = connectionMap[connectionId];
279
+ if (connectionInfo && proxy_stats) {
280
+ const { type } = connectionInfo;
281
+ if (stats[type]) {
282
+ stats[type].request++;
283
+ stats[type].Tx += connStats.srcTxBytes;
284
+ stats[type].Rx += connStats.srcRxBytes;
285
+ }
286
+ }
287
+ delete connectionMap[connectionId];
288
+ });
289
+
290
+ try {
291
+ await server.listen();
292
+ console.log(`✅ Local Proxy Started: http://127.0.0.1:${selectedPort}`);
293
+ } catch (err) {
294
+ console.error("❌ Failed to start proxy server:", err);
295
+ return null;
296
+ }
297
+
298
+ const formatBytes = (bytes) => (bytes / 1024 / 1024).toFixed(2);
299
+
300
+ // 7. Return Controller
301
+ return {
302
+ port: selectedPort,
303
+ proxyUrl: `http://127.0.0.1:${selectedPort}`,
304
+
305
+ details: {
306
+ default: defaultDetails,
307
+ proxy1: p1Details,
308
+ proxy2: p2Details,
309
+ },
310
+
311
+ // If proxy is set -> returns timezone. If proxy is NOT set (null) -> returns null.
312
+ // Playwright handles null nicely (uses system time).
313
+ DEFAULT_PROXY_TIMEZONE: defaultDetails?.timezoneId || null,
314
+ PROXY_1_TIMEZONE: p1Details?.timezoneId || null,
315
+ PROXY_2_TIMEZONE: p2Details?.timezoneId || null,
316
+
317
+ DEFAULT_PROXY_IP: defaultDetails?.ip || null,
318
+ PROXY_1_IP: p1Details?.ip || null,
319
+ PROXY_2_IP: p2Details?.ip || null,
320
+
321
+ closeServer: async () => {
322
+ await server.close(true);
323
+ console.log("🔒 Proxy server closed.");
324
+ },
325
+ getProxyStats: () => {
326
+ const formatted = {};
327
+ for (const [key, val] of Object.entries(stats)) {
328
+ formatted[key] = {
329
+ req: val.request,
330
+ Tx: formatBytes(val.Tx) + " MB",
331
+ Rx: formatBytes(val.Rx) + " MB",
332
+ };
333
+ }
334
+ return formatted;
335
+ },
336
+ };
337
+ }
@@ -0,0 +1,91 @@
1
+ /**
2
+ * Standard Proxy Object structure used across the application.
3
+ */
4
+ export interface ProxyObject {
5
+ /** The protocol type (e.g., 'http', 'https', 'socks5'). */
6
+ type: string;
7
+ /** The IP address or hostname. */
8
+ host: string;
9
+ /** The port number. */
10
+ port: number;
11
+ /** Authentication username (if applicable). */
12
+ user?: string;
13
+ /** Authentication password (if applicable). */
14
+ pass?: string;
15
+ }
16
+
17
+ /**
18
+ * Options for configuring the Multilogin proxy request.
19
+ */
20
+ export interface MultiloginProxyOptions {
21
+ /** ISO country code (e.g., "us", "gb", "any"). Default: "us" */
22
+ country?: string;
23
+ /** Session behavior: "sticky" or "rotating". Default: "sticky" */
24
+ sessionType?: string;
25
+ /** Connection protocol: "http", "https", "socks5". Default: "http" */
26
+ protocol?: string;
27
+ /** Specific region/state in snake_case (optional). */
28
+ region?: string;
29
+ /** Specific city in snake_case (optional). */
30
+ city?: string;
31
+ /** IP Time-To-Live in seconds for rotating sessions. Default: 1800 */
32
+ IPTTL?: number;
33
+ /** Enable strict mode for the Multilogin API. Default: false */
34
+ strictMode?: boolean;
35
+ }
36
+
37
+ /**
38
+ * Represents a row from the 'x_accounts_proxy' database table.
39
+ */
40
+ export interface XProxyRow {
41
+ id: string | number;
42
+ provider?: string;
43
+ total_used: number;
44
+ last_used_time: string;
45
+ status: number;
46
+ [key: string]: any;
47
+ }
48
+
49
+ /**
50
+ * State object used to manage rotating AWS proxies.
51
+ */
52
+ export interface ProxyState {
53
+ /** Flag to prevent concurrent fetches. */
54
+ isFetching: boolean;
55
+ /** The AWS instance name (ID) associated with this proxy state. */
56
+ proxyInstance: string;
57
+ /** The current active proxy object. */
58
+ proxy?: ProxyObject | { host: string; port: number } | null;
59
+ /** Counter for how many times the current proxy has been used. */
60
+ proxyUsed: number;
61
+ [key: string]: any;
62
+ }
63
+
64
+ /**
65
+ * Fetches and parses a Multilogin proxy.
66
+ * Always requests a single proxy count.
67
+ * @returns The proxy object or null on failure/timeout.
68
+ */
69
+ export function get_multilogin_proxy(options?: MultiloginProxyOptions): Promise<ProxyObject | null>;
70
+
71
+ /**
72
+ * Generates a PacketStream proxy object with a random session ID.
73
+ * Credentials are loaded dynamically from 'browser_automation_env.js'.
74
+ * @returns The proxy object.
75
+ */
76
+ export function get_packetstream_proxy(): Promise<ProxyObject>;
77
+
78
+ /**
79
+ * Fetches the least recently used proxy from the 'x_accounts_proxy' database table.
80
+ * Automatically increments usage stats.
81
+ * @param options Object containing optional provider filter.
82
+ * @returns The database row for the proxy or null if none found.
83
+ */
84
+ export function get_x_proxy(options: { provider?: string }): Promise<XProxyRow | null>;
85
+
86
+ /**
87
+ * Triggers a background fetch for a new AWS proxy IP to rotate the current session.
88
+ * Mutates the provided 'proxies' state object.
89
+ * @param proxies The state object containing current proxy details and flags.
90
+ */
91
+ export function fetchNextProxy(proxies: ProxyState): void;