mirror of
https://github.com/aculix/ticket-monitoring.git
synced 2026-10-27 07:15:51 +00:00
fix: make the SOCKS5 proxy work for BookMyShow too
BookMyShow blocks datacenter IPs on top of TLS fingerprinting, confirmed by CI runners getting 403 with a working impersonation, so cloud hosts need the proxy for BMS as well as District. impit resolves DNS locally for socks5:// and hands an IPv6-only exit an unreachable IPv4 address, so the scheme is normalized to socks5h://. Verified end to end: a proxied BMS check returns 200 and alerts. Docs said the proxy did nothing for BookMyShow, which was wrong.
This commit is contained in:
1 parent
608221fe18
commit
5f86252df1
4 files changed
+28
-13
No files matched your search
@@ -18,9 +18,13 @@ let client = null;
|
||||
async function getClient(cfg) {
|
||||
if (client) return client;
|
||||
if (!Impit) ({ Impit } = await import("impit"));
|
||||
// With socks5:// impit resolves DNS locally and asks the proxy for that address,
|
||||
// which fails outright on an IPv6-only exit that cannot reach the IPv4 we picked.
|
||||
// socks5h:// leaves resolution to the proxy, so normalize to it.
|
||||
const proxyUrl = cfg.proxyUrl ? cfg.proxyUrl.replace(/^socks5:\/\//i, "socks5h://") : "";
|
||||
client = new Impit({
|
||||
browser: "chrome",
|
||||
...(cfg.proxyUrl ? { proxyUrl: cfg.proxyUrl } : {}),
|
||||
...(proxyUrl ? { proxyUrl } : {}),
|
||||
});
|
||||
return client;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user