also add socks proxy
This commit is contained in:
parent
988da93cc8
commit
6492999506
|
|
@ -508,6 +508,10 @@ export abstract class APIRequestContext extends SdkObject {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// when using socks proxy, having the socket means the connection got established
|
||||||
|
if (agent instanceof SocksProxyAgent)
|
||||||
|
tcpConnectionAt ??= monotonicTime();
|
||||||
|
|
||||||
serverIPAddress = socket.remoteAddress;
|
serverIPAddress = socket.remoteAddress;
|
||||||
serverPort = socket.remotePort;
|
serverPort = socket.remotePort;
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -868,8 +868,7 @@ it('should include timings when using http proxy', async ({ contextFactory, serv
|
||||||
expect(log.entries[0].timings.connect).toBeGreaterThan(0);
|
expect(log.entries[0].timings.connect).toBeGreaterThan(0);
|
||||||
});
|
});
|
||||||
|
|
||||||
// socks proxy library doesnt emit an event to know when the TCP connection starts
|
it('should include timings when using socks proxy', async ({ contextFactory, server, socksPort }, testInfo) => {
|
||||||
it.fail('should include timings when using socks proxy', async ({ contextFactory, server, socksPort }, testInfo) => {
|
|
||||||
const { page, getLog } = await pageWithHar(contextFactory, testInfo, { proxy: { server: `socks5://localhost:${socksPort}` } });
|
const { page, getLog } = await pageWithHar(contextFactory, testInfo, { proxy: { server: `socks5://localhost:${socksPort}` } });
|
||||||
const response = await page.request.get(server.EMPTY_PAGE);
|
const response = await page.request.get(server.EMPTY_PAGE);
|
||||||
await response.body();
|
await response.body();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue