Skip to content

Commit 22ac4e5

Browse files
committed
chore: use simple-socks as async import
1 parent 1afe045 commit 22ac4e5

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

test/fixtures/server.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ const http = require('http')
99
const https = require('https')
1010
const timers = require('timers/promises')
1111
const { pipeline } = require('stream/promises')
12-
const simpleSocks = require('simple-socks')
1312
const fetch = require('minipass-fetch')
1413

1514
const parseAuthHeader = (header) => {
@@ -275,7 +274,7 @@ class HttpsProxy extends HttpProxy {
275274
class SocksProxy extends Server {
276275
#failConnect
277276

278-
constructor (t, { protocol = 'socks:', failConnect, ...options } = {}) {
277+
constructor (t, { protocol = 'socks:', simpleSocks, failConnect, ...options } = {}) {
279278
super(t, {
280279
...options,
281280
protocol,

test/fixtures/setup.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ const createSetup = ({ serverTls, proxyTls, ...baseOpts }) => {
6262
proxy = new Proxy[baseOpts.proxy?.type ?? `${tlsType(proxyTls)}To${serverType}`](t, {
6363
...baseOpts.proxy,
6464
...opts.proxy,
65+
simpleSocks: await import('simple-socks').then(r => r.default),
6566
httpAgent: new HttpAgent(omit(agentOpts, 'timeouts')),
6667
httpsAgent: new HttpsAgent(omit(agentOpts, 'timeouts')),
6768
})

0 commit comments

Comments
 (0)