gologin 2.1.24 → 2.1.26

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.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
  Combined changelog for GoLogin node.js SDK
4
4
 
5
+ ## [2.1.26] 2025-07-02
6
+
7
+
8
+ ### Fixes
9
+
10
+ * Socks 5 proxy passing
11
+
5
12
  ## [2.1.24] 2025-06-16
6
13
 
7
14
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gologin",
3
- "version": "2.1.24",
3
+ "version": "2.1.26",
4
4
  "description": "A high-level API to control Orbita browser over GoLogin API",
5
5
  "types": "./index.d.ts",
6
6
  "main": "./src/gologin.js",
@@ -2,7 +2,8 @@ import { createWriteStream, promises as _promises } from 'fs';
2
2
  import { join, sep } from 'path';
3
3
  import request from 'requestretry';
4
4
 
5
- import { CHROME_EXTENSIONS_PATH, composeExtractionPromises, USER_EXTENSIONS_PATH } from '../utils/common.js';
5
+ import { CHROME_EXTENSIONS_PATH, composeExtractionPromises, FALLBACK_API_URL, USER_EXTENSIONS_PATH } from '../utils/common.js';
6
+ import { makeRequest } from '../utils/http.js';
6
7
 
7
8
  const { readdir, readFile, stat, mkdir, copyFile } = _promises;
8
9
 
@@ -240,11 +240,11 @@ export const GologinApi = ({ token }) => {
240
240
  },
241
241
 
242
242
  async exit() {
243
- Promise.allSettled(browsers.map((browser) => browser.close()));
244
- Promise.allSettled(
243
+ await Promise.allSettled(browsers.map((browser) => browser.close()));
244
+ await Promise.allSettled(
245
245
  legacyGls.map((gl) => gl.stopLocal({ posting: true })),
246
246
  );
247
- Promise.allSettled(
247
+ await Promise.allSettled(
248
248
  legacyGls.map((gl) => gl.stopRemote({ posting: true })),
249
249
  );
250
250
  },
package/src/gologin.js CHANGED
@@ -85,6 +85,8 @@ export class GoLogin {
85
85
  Sentry.init({
86
86
  dsn: 'https://a13d5939a60ae4f6583e228597f1f2a0@sentry-new.amzn.pro/24',
87
87
  tracesSampleRate: 1.0,
88
+ defaultIntegrations: false,
89
+ release: process.env.npm_package_version || '2.1.24',
88
90
  });
89
91
  }
90
92
 
@@ -315,7 +317,6 @@ export class GoLogin {
315
317
  },
316
318
  };
317
319
 
318
- console.log('profileData.proxy', profileData);
319
320
  if (browserMajorVersion >= this.newProxyOrbbitaMajorVersion && profileData.proxy?.mode !== 'none') {
320
321
  let proxyServer = `${profileData.proxy.mode}://`;
321
322
  if (profileData.proxy.username) {
@@ -645,8 +646,9 @@ export class GoLogin {
645
646
  }
646
647
 
647
648
  async commitProfile() {
648
- const dataBuff = await this.getProfileDataToUpdate();
649
-
649
+ // wait for orbita to finish working with files
650
+ await new Promise((resolve) => setTimeout(resolve, 2000));
651
+ const dataBuff = await this.getProfileDataToUpdate().catch(console.log);
650
652
  debug('begin updating', dataBuff.length);
651
653
  if (!dataBuff.length) {
652
654
  debug('WARN: profile zip data empty - SKIPPING PROFILE COMMIT');
@@ -783,7 +785,7 @@ export class GoLogin {
783
785
 
784
786
  const checkData = await checkSocksProxy(agent);
785
787
 
786
- const body = checkData || {};
788
+ const body = checkData.body || {};
787
789
  if (!body.ip && checkData.statusCode.toString().startsWith('4')) {
788
790
  throw checkData;
789
791
  }
@@ -927,10 +929,13 @@ export class GoLogin {
927
929
 
928
930
  if (proxy) {
929
931
  const hr_rules = `"MAP * 0.0.0.0 , EXCLUDE ${proxy_host}"`;
930
- params.push(`--proxy-server=${proxy}`);
931
932
  params.push(`--host-resolver-rules=${hr_rules}`);
932
933
  }
933
934
 
935
+ if (proxy && Number(this.browserMajorVersion) < this.newProxyOrbbitaMajorVersion) {
936
+ params.push(`--proxy-server=${proxy}`);
937
+ }
938
+
934
939
  if (Array.isArray(this.extra_params) && this.extra_params.length) {
935
940
  params = params.concat(this.extra_params);
936
941
  }
@@ -943,9 +948,8 @@ export class GoLogin {
943
948
  console.log('params', params);
944
949
  const child = execFile(ORBITA_BROWSER, params, { env });
945
950
  this.processSpawned = child;
946
- // const child = spawn(ORBITA_BROWSER, params, { env, shell: true });
947
- child.stdout.on('error', (data) => console.log(data.toString()));
948
- child.stderr.on('data', (data) => console.log(data.toString()));
951
+ // child.stdout.on('error', (data) => console.log(data.toString()));
952
+ // child.stderr.on('data', (data) => console.log(data.toString()));
949
953
  debug('SPAWN CMD', ORBITA_BROWSER, params.join(' '));
950
954
  }
951
955