Skip to content

Commit 2cdb046

Browse files
committed
Switch to os-proxy-config for detection & update mac detection for fixes
Previously, scutil parsing errors weren't caught correctly, which could cause crashes in some environments (although I'm still not actually sure _which_ environments...)
1 parent 2e46a9d commit 2cdb046

File tree

4 files changed

+18
-73
lines changed

4 files changed

+18
-73
lines changed

package-lock.json

Lines changed: 12 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
"homepage": "https://github.com/httptoolkit/httptoolkit-server",
2727
"bugs": "https://github.com/httptoolkit/httptoolkit-server/issues",
2828
"dependencies": {
29-
"@cypress/get-windows-proxy": "^1.6.2",
3029
"@devicefarmer/adbkit": "^2.11.2",
3130
"@graphql-tools/schema": "^6.0.18",
3231
"@graphql-tools/utils": "^6.0.18",
@@ -54,12 +53,12 @@
5453
"iconv-lite": "^0.4.24",
5554
"lodash": "^4.17.21",
5655
"lookpath": "^1.2.1",
57-
"mac-system-proxy": "^1.0.0",
5856
"mime-types": "^2.1.27",
5957
"mockttp": "^2.0.0",
6058
"node-fetch": "^2.6.1",
6159
"node-forge": "^0.10.0",
6260
"node-gsettings-wrapper": "^0.5.0",
61+
"os-proxy-config": "^1.0.0",
6362
"portfinder": "^1.0.25",
6463
"registry-js": "^1.10.0",
6564
"rimraf": "^2.6.2",

src/api-server.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import { reportError, addBreadcrumb } from './error-tracking';
1515
import { buildInterceptors, Interceptor, ActivationError } from './interceptors';
1616
import { ALLOWED_ORIGINS } from './constants';
1717
import { delay } from './util';
18-
import { getSystemProxyConfig } from './detect-proxy';
18+
import { getSystemProxy } from 'os-proxy-config';
1919

2020
const ENABLE_PLAYGROUND = false;
2121

@@ -124,7 +124,10 @@ const buildResolvers = (
124124
certificateFingerprint: generateSPKIFingerprint(config.https.certContent)
125125
}),
126126
networkInterfaces: () => os.networkInterfaces(),
127-
systemProxy: () => getSystemProxyConfig()
127+
systemProxy: () => getSystemProxy().catch((e) => {
128+
reportError(e);
129+
return undefined;
130+
})
128131
},
129132

130133
Mutation: {

src/detect-proxy.ts

Lines changed: 0 additions & 66 deletions
This file was deleted.

0 commit comments

Comments
 (0)