Skip to content

Commit

Permalink
Update "async-listen" to v3.0.0 for all packages
Browse files Browse the repository at this point in the history
  • Loading branch information
TooTallNate committed May 24, 2023
1 parent 8c320cf commit d5f3d3f
Show file tree
Hide file tree
Showing 15 changed files with 43 additions and 48 deletions.
2 changes: 1 addition & 1 deletion packages/agent-base/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"@types/node": "^14.18.45",
"@types/semver": "^7.3.13",
"@types/ws": "^6.0.4",
"async-listen": "^2.1.0",
"async-listen": "^3.0.0",
"jest": "^29.5.0",
"ts-jest": "^29.1.0",
"tsconfig": "workspace:*",
Expand Down
6 changes: 3 additions & 3 deletions packages/agent-base/test/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -265,14 +265,14 @@ describe('Agent (TypeScript)', () => {
reqCount1++;
res.end();
});
const addr1 = (await listen(server1)) as URL;
const addr1 = await listen(server1);

const server2 = http.createServer((req, res) => {
expect(req.headers.connection).toEqual('keep-alive');
reqCount2++;
res.end();
});
const addr2 = (await listen(server2)) as URL;
const addr2 = await listen(server2);

try {
const res = await req(new URL('/foo', addr1), { agent });
Expand Down Expand Up @@ -479,7 +479,7 @@ describe('Agent (TypeScript)', () => {
gotReq = true;
res.end();
});
const addr = (await listen(server)) as URL;
const addr = await listen(server);

try {
const res = await req(new URL('/foo', addr), {
Expand Down
2 changes: 1 addition & 1 deletion packages/get-uri/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"@types/ftpd": "^0.2.35",
"@types/jest": "^29.5.1",
"@types/node": "^14.18.45",
"async-listen": "^2.1.0",
"async-listen": "^3.0.0",
"ftpd": "https://files-jg1s1zt9l.n8.io/ftpd-v0.2.14.tgz",
"jest": "^29.5.0",
"st": "^1.2.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/http-proxy-agent/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"@types/debug": "^4.1.7",
"@types/jest": "^29.5.1",
"@types/node": "^14.18.45",
"async-listen": "^2.1.0",
"async-listen": "^3.0.0",
"jest": "^29.5.0",
"proxy": "workspace:*",
"ts-jest": "^29.1.0",
Expand Down
6 changes: 3 additions & 3 deletions packages/http-proxy-agent/test/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ describe('HttpProxyAgent', () => {
beforeAll(async () => {
// setup HTTP proxy server
proxy = createProxy();
proxyUrl = (await listen(proxy)) as URL;
proxyUrl = await listen(proxy);
});

beforeAll(async () => {
// setup target HTTP server
httpServer = http.createServer();
httpServerUrl = (await listen(httpServer)) as URL;
httpServerUrl = await listen(httpServer);
});

beforeAll(async () => {
Expand All @@ -36,7 +36,7 @@ describe('HttpProxyAgent', () => {
cert: fs.readFileSync(`${__dirname}/ssl-cert-snakeoil.pem`),
};
sslProxy = createProxy(https.createServer(options));
sslProxyUrl = (await listen(sslProxy)) as URL;
sslProxyUrl = await listen(sslProxy);
});

beforeEach(() => {
Expand Down
8 changes: 4 additions & 4 deletions packages/https-proxy-agent/test/test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import fs from 'fs';
import net from 'net';
import http from 'http';
import https from 'https';
import * as fs from 'fs';
import * as net from 'net';
import * as http from 'http';
import * as https from 'https';
import assert from 'assert';
import { once } from 'events';
import { listen } from 'async-listen';
Expand Down
2 changes: 1 addition & 1 deletion packages/pac-proxy-agent/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"@types/debug": "^4.1.7",
"@types/jest": "^29.5.1",
"@types/node": "^14.18.45",
"async-listen": "^2.1.0",
"async-listen": "^3.0.0",
"jest": "^29.5.0",
"proxy": "workspace:*",
"socksv5": "0.0.6",
Expand Down
8 changes: 4 additions & 4 deletions packages/pac-proxy-agent/test/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ describe('PacProxyAgent', () => {
beforeAll(async () => {
// setup target HTTP server
httpServer = http.createServer();
httpServerUrl = (await listen(httpServer)) as URL;
httpServerUrl = await listen(httpServer);
});

beforeAll(async () => {
// setup target SSL HTTPS server
httpsServer = https.createServer(sslOptions);
httpsServerUrl = (await listen(httpsServer)) as URL;
httpsServerUrl = await listen(httpsServer);
});

beforeAll(async () => {
Expand All @@ -57,13 +57,13 @@ describe('PacProxyAgent', () => {
beforeAll(async () => {
// setup HTTP proxy server
proxyServer = createProxy();
proxyServerUrl = (await listen(proxyServer)) as URL;
proxyServerUrl = await listen(proxyServer);
});

beforeAll(async () => {
// setup SSL HTTPS proxy server
proxyHttpsServer = createProxy(https.createServer(sslOptions));
proxyHttpsServerUrl = (await listen(proxyHttpsServer)) as URL;
proxyHttpsServerUrl = await listen(proxyHttpsServer);
});

afterAll(() => {
Expand Down
2 changes: 1 addition & 1 deletion packages/proxy-agent/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"@types/jest": "^29.5.1",
"@types/node": "^14.18.45",
"@types/proxy-from-env": "^1.0.1",
"async-listen": "^2.1.0",
"async-listen": "^3.0.0",
"jest": "^29.5.0",
"proxy": "workspace:*",
"socksv5": "github:TooTallNate/socksv5#fix/dstSock-close-event",
Expand Down
8 changes: 4 additions & 4 deletions packages/proxy-agent/test/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ describe('ProxyAgent', () => {
beforeAll(async () => {
// setup target HTTP server
httpServer = http.createServer();
httpServerUrl = (await listen(httpServer)) as URL;
httpServerUrl = await listen(httpServer);
});

beforeAll(async () => {
// setup target SSL HTTPS server
httpsServer = https.createServer(sslOptions);
httpsServerUrl = (await listen(httpsServer)) as URL;
httpsServerUrl = await listen(httpsServer);
});

beforeAll(async () => {
Expand All @@ -59,13 +59,13 @@ describe('ProxyAgent', () => {
beforeAll(async () => {
// setup HTTP proxy server
httpProxyServer = createProxy();
httpProxyServerUrl = (await listen(httpProxyServer)) as URL;
httpProxyServerUrl = await listen(httpProxyServer);
});

beforeAll(async () => {
// setup SSL HTTPS proxy server
httpsProxyServer = createProxy(https.createServer(sslOptions));
httpsProxyServerUrl = (await listen(httpsProxyServer)) as URL;
httpsProxyServerUrl = await listen(httpsProxyServer);
});

afterAll(() => {
Expand Down
2 changes: 1 addition & 1 deletion packages/proxy/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"@types/debug": "^4.1.7",
"@types/jest": "^29.5.1",
"@types/node": "^14.18.45",
"async-listen": "^2.1.0",
"async-listen": "^3.0.0",
"jest": "^29.5.0",
"ts-jest": "^29.1.0",
"tsconfig": "workspace:*",
Expand Down
4 changes: 2 additions & 2 deletions packages/proxy/test/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ describe('proxy', () => {
beforeAll(async () => {
// setup proxy server
proxy = createProxy(http.createServer());
proxyUrl = (await listen(proxy)) as URL;
proxyUrl = await listen(proxy);
});

beforeAll(async () => {
// setup target server
server = http.createServer();
serverUrl = (await listen(server)) as URL;
serverUrl = await listen(server);
});

afterAll(() => {
Expand Down
2 changes: 1 addition & 1 deletion packages/socks-proxy-agent/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
"@types/dns2": "^2.0.3",
"@types/jest": "^29.5.1",
"@types/node": "^14.18.45",
"async-listen": "^2.1.0",
"async-listen": "^3.0.0",
"async-retry": "^1.3.3",
"cacheable-lookup": "^6.1.0",
"dns2": "^2.1.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/socks-proxy-agent/test/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ describe('SocksProxyAgent', () => {
beforeAll(async () => {
// setup target HTTP server
httpServer = http.createServer();
httpServerUrl = (await listen(httpServer)) as URL;
httpServerUrl = await listen(httpServer);
});

beforeAll(async () => {
Expand All @@ -50,7 +50,7 @@ describe('SocksProxyAgent', () => {
),
};
httpsServer = https.createServer(options);
httpsServerUrl = (await listen(httpsServer)) as URL;
httpsServerUrl = await listen(httpsServer);
});

afterAll(() => {
Expand Down
33 changes: 14 additions & 19 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 comment on commit d5f3d3f

@vercel
Copy link

@vercel vercel bot commented on d5f3d3f May 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

proxy-agents – ./

proxy-agents.vercel.app
proxy-agents-git-main-tootallnate.vercel.app
proxy-agents-tootallnate.vercel.app

Please sign in to comment.