maple3142 / cf-warp

MIT License
449 stars 64 forks source link

You need to request a delay to generate a fake referrer #4

Closed zeroday0619 closed 4 years ago

zeroday0619 commented 4 years ago

function sleep(ms) { return new Promise((resolve) => { setTimeout(resolve, ms); }); }

    if (!isNaN(n)) {
            console.log(`Prepare faking Warp+ referrer for ${n} times.`)
            for (let i = 1; i <= n; i++) {
                    await sleep(20000)
                    await ref(data)
                    console.log(`#${i} fake referrer finished`)
            }
            console.log()
    }
zeroday0619 commented 4 years ago

$ cf-warp 10 Prepare faking Warp+ referrer for 10 times.

1 fake referrer finished

2 fake referrer finished

(node:29379) UnhandledPromiseRejectionWarning: HTTPError: Too Many Requests at responseErrorThrower (/data/data/com.termux/files/usr/lib/node_modules/cf-warp/node_modules/xfetch-js/xfetch.js:37:22) at processTicksAndRejections (internal/process/task_queues.js:93:5) at async module.exports (/data/data/com.termux/files/usr/lib/node_modules/cf-warp/lib/register.js:11:15) at async module.exports (/data/data/com.termux/files/usr/lib/node_modules/cf-warp/lib/ref.js:4:2) at async /data/data/com.termux/files/usr/lib/node_modules/cf-warp/cli.js:64:4 (node:29379) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1) (node:29379) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

zeroday0619 commented 4 years ago

https://github.com/maple3142/cf-warp/pull/5