hel 1 gadu atpakaļ
vecāks
revīzija
f7de441084
2 mainītis faili ar 21 papildinājumiem un 4 dzēšanām
  1. 11 3
      src/BaseClient.ts
  2. 10 1
      src/utils/index.ts

+ 11 - 3
src/BaseClient.ts

@@ -40,9 +40,17 @@ export abstract class BaseClient {
     })
     const rpc = rpcUrl[Math.floor(Math.random() * rpcUrl.length)]
     const pass = `test1234_session-${generateRandomString(8)}_lifetime-20m`
-    const proxyAgent = useProxy
-      ? new HttpsProxyAgent(`http://tuxla:${pass}@geo.iproyal.com:12321`)
-      : undefined
+    // const proxyAgent = useProxy
+    //   ? new HttpsProxyAgent(`http://tuxla:${pass}@geo.iproyal.com:12321`)
+    //   : undefined
+    const username = `u3e4c2852572e05c5-zone-custom-session-${generateRandomString(
+      9,
+    )}-sessTime-20`
+    const password = 'u3e4c2852572e05c5'
+    const proxyAgent = new HttpsProxyAgent(
+      `http://${username}:${password}@43.152.113.55:2334`,
+    )
+
     const requester = new APIRequester(rpc, {
       httpsAgent: proxyAgent,
       headers: {

+ 10 - 1
src/utils/index.ts

@@ -20,10 +20,19 @@ export function getProxyUrl() {
   return `http://tuxla:${pass}@geo.iproyal.com:12321`
 }
 
+export function generate2CaptchaProxyAgent(){
+  const username = `u3e4c2852572e05c5-zone-custom-session-${generateRandomString(9)}-sessTime-20`
+  const password = 'u3e4c2852572e05c5'
+  return new HttpsProxyAgent(`http://${username}:${password}@43.152.113.55:2334`)
+}
+
 export function getAxiosClient(useProxy: boolean) {
   const pass = `test1234_session-${generateRandomString(8)}_lifetime-1h`
+  // const proxyAgent = useProxy
+  //   ? new HttpsProxyAgent(`http://tuxla:${pass}@geo.iproyal.com:12321`)
+  //   : undefined
   const proxyAgent = useProxy
-    ? new HttpsProxyAgent(`http://tuxla:${pass}@geo.iproyal.com:12321`)
+    ? generate2CaptchaProxyAgent()
     : undefined
   return axios.create({
     httpsAgent: proxyAgent,