CloudFlare出了个免费翻墙app,分享链接给朋友安装就会获得1GB流量,大佬发了个nodejs版和python版刷流量代码

流量跟随APP,卸载app流量会消失!

去APP里获取ID

点击APP右上角菜单 => 拉到下面点 More settings=> 点Diagnostics=> 在CLIENT CONFIGURATION栏中查看ID

复制ID去下列代码中

const referrer = "ID 复制到此处"
循环次数可以修改,一次不要改太多!默认是10

// Fake register for referrer to get warp plus bandwidth
const referrer = "AFF ID复制到这里"; 
const timesToLoop = 10; // 循环次数
const retryTimes = 5; // 重试次数

const https = require("https");
const zlib = require("zlib");

async function init() {
  for (let i = 0; i < timesToLoop; i++) {
    if (await run()) {
      console.log(i + 1, "OK");
    } else {
      console.log(i + 1, "Error");
      for (let r = 0; r < retryTimes; r++) {
        if (await run()) {
          console.log(i + 1, "Retry #" + (r + 1), "OK");
          break;
        } else {
          console.log(i + 1, "Retry #" + (r + 1), "Error");
          if (r === retryTimes - 1) {
            return;
          }
        }
      }
    }
  }
}

async function run() {
  return new Promise(resolve => {
    const install_id = genString(11);
    const postData = JSON.stringify({
      key: `${genString(43)}=`,
      install_id: install_id,
      fcm_token: `${install_id}:APA91b${genString(134)}`,
      referrer: referrer,
      warp_enabled: false,
      tos: new Date().toISOString().replace("Z", "+07:00"),
      type: "Android",
      locale: "zh_CN"
    });

    const options = {
      hostname: "api.cloudflareclient.com",
      port: 443,
      path: "/v0a745/reg",
      method: "POST",
      headers: {
        "Content-Type": "application/json",
        Host: "api.cloudflareclient.com",
        Connection: "Keep-Alive",
        "Accept-Encoding": "gzip",
        "User-Agent": "okhttp/3.12.1",
        "Content-Length": postData.length
      }
    };

    const req = https.request(options, res => {
      const gzip = zlib.createGunzip();
      // const buffer = [];
      res.pipe(gzip);
      gzip
        .on("data", function(data) {
          // buffer.push(data.toString());
        })
        .on("end", function() {
          // console.dir(JSON.parse(buffer.join("")));
          resolve(true);
        })
        .on("error", function(e) {
          // console.error(e);
          resolve(false);
        });
    });

    req.on("error", error => {
      // console.error(error);
      resolve(false);
    });

    req.write(postData);
    req.end();
  });
}

function genString(length) {
  // https://gist.github.com/6174/6062387#gistcomment-2651745
  return [...Array(length)]
    .map(i => (~~(Math.random() * 36)).toString(36))
    .join("");
}

init();

运行nodejs代码

打开在线nodejs网站: https://repl.it/languages/nodejs

点击run运行运行以上代码右侧会出现OK会发现APP已经增加了流量

CFWnodejs
CFWnodejs

https://www.hostloc.com/thread-590354-1-1.html
https://github.com/yyuueexxiinngg/some-scripts/tree/master/cloudflare