Giter VIP home page Giter VIP logo

cf-warp's Introduction

cf-warp

A simple cli to get Warp+ as WireGuard configuration

For people who just want a easy way to get a WireGuard of Warp, just download this file: https://cf-warp.maple3142.net/warp.conf. Source code of the backend can be found here.

Usage

By using this, you agree the Privacy Policy and Terms of Service of Cloudflare 1.1.1.1

With Node.js (Recommended)

Step 1

Install cf-warp globally through yarn or npm.

yarn global add cf-warp # npm i -g cf-warp

Step 2

Initialize your Warp+ account by running cf-warp command.

Example:

$ cf-warp
Your Warp credentials are located at "C:\Users\maple3142\.cf-warp\data.json", and WireGuard connection file is "C:\Users\maple3142\.cf-warp\cf-warp.conf".
You currently have 1GB Warp+ quota.
To get your current Warp+ quota, simply run "cf-warp".
To increase your Warp+ quota by 10 GB, simply run "cf-warp 10".

Step 3

Obtain cf-warp.conf from ~/.cf-warp/cf-warp.conf and use it normally.

Without Node.js

Step 1

Go ahead to releases page and download a binary for your platform.

Step 2

Open your cmd/terminal and locate the binary you just downloaded, such as cf-warp-win.exe ...

Step 3

Use it just like cf-warp installed by npm.

With Docker

Step 1

docker run --rm -v ~/.cf-warp:/root/.cf-warp maple3142/cf-warp [args]

FAQ

How does cf-warp get Warp+ quota for free?

It currently get quota by faking referrers since there is no way to pay for premium version outside of 1.1.1.1 app, but it is recommended to pay for it on your phone if you think their service is good.

How do link this to a WARP+ license from the mobile 1.1.1.1 app?

  1. Find your license key on your mobile 1.1.1.1 app
    • It should be under settings/account/key, in the form of "1a2b3d4e-1a2b3d4e-1a2b3d4e"
  2. Copy that key, and run the command:
cf-warp --license 1a2b3d4e-1a2b3d4e-1a2b3d4e #Your own license key goes here
  1. When done, the current config should be sharing the same data quota as the mobile 1.1.1.1
    • If you've paid on your phone, this config should enjoy unlimited data and WARP+.

IPv6 doesn't works in Linux by default

Due to the private tunnel local address Linux needs getaddrinfo configuration.

Thanks

https://github.com/yyuueexxiinngg/some-scripts/tree/master/cloudflare

cf-warp's People

Contributors

eligao avatar maple3142 avatar oott123 avatar oskar456 avatar paulcarroty avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cf-warp's Issues

How do I uninstall this from npm?

I tried npm remove -g cf-warp and npm uninstall -g cf-warp from PowerShell as administrator. When I type cf-warp in PowerShell afterwards, it still comes up.
image

Unable to use Warp+

After following the instructions and even doing a reinstall https://www.cloudflare.com/cdn-cgi/trace is still saying warp=on instead of warp=plus. As far as I can see from the data.json it should be enabled and cf-warp says that I have warp+ quota.

If I'm missing something or have done something wrong any help would be appreciated.

i cant install cf-warp

Screenshot_20211129-175657
I want to install cf-warp using yarn
yarn global add cf-warp
But I can't, I took a picture that shows the problem

Glitch.me link is broken

I keep getting errors when visiting glitch.me the site keeps saying "Site didn't respond
Something in the code caused it to close the connection before providing a response.

If this is your project please visit us at support.glitch.com for assistance."

running cf-warp does not update quota

as said, however running it with --license does update it, probably as it forces a new setup?

This happens sporadically often on windows, but almost always on linux.

You need to request a delay to generate a fake referrer

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()
    }

ubuntu focal in oracle cloud , cf-warp run error

OS: ubuntu 20.04
install cf-warp using npm i -g cf-warp , then run cf-warp will return error

cf-warp
Initializing Warp credentials...

(node:14589) UnhandledPromiseRejectionWarning: Error [ERR_SOCKET_CLOSED]: Socket is closed
    at TLSSocket.Socket._writeGeneric (net.js:704:18)
    at TLSSocket.connect (net.js:696:12)
    at Object.onceWrapper (events.js:286:20)
    at TLSSocket.emit (events.js:203:15)
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1093:10)
(node:14589) 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:14589) [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.

download cli-linux then run cli-linux , there's another problem.

root@warp-cowbay-org:~/git/cf-warp# ./cli-linux 
Initializing Warp credentials...

(node:14614) UnhandledPromiseRejectionWarning: SyntaxError: Unexpected token e in JSON at position 0
    at JSON.parse (<anonymous>)
    at /snapshot/cf-warp/lib/register.js
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async init (/snapshot/cf-warp/cli.js)
(node:14614) 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:14614) [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.
root@warp-cowbay-org:~/git/cf-warp# 

Config File Parse Error

I try to set the config using :

wg setconf wg0 /home/user/.cf-warp/cf-warp.conf

But wg show error message:

Line unrecognized: `Address=172.16.0.2'
Configuration parsing error

UnhandledPromiseRejectionWarning when trying to increase quota

Been getting the following error for the past few days whenever I try to increase Warp+ quota:

PS > cf-warp 10
Prepare faking Warp+ referrer for 10 times.
(node:9748) UnhandledPromiseRejectionWarning: SyntaxError: Unexpected token e in JSON at position 0
    at JSON.parse (<anonymous>)
    at module.exports (O:\bin\node_14_13_0_npm_6_14_8\node_modules\cf-warp\lib\register.js:30:14)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async module.exports (O:\bin\node_14_13_0_npm_6_14_8\node_modules\cf-warp\lib\ref.js:4:2)
    at async O:\bin\node_14_13_0_npm_6_14_8\node_modules\cf-warp\cli.js:83:4
(Use `node --trace-warnings ...` to show where the warning was created)
(node:9748) 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(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:9748) [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.

Quota doesn't seem to increase.

A Request

Hey maple , can u make a python or node.js script that will give bandwidth balance of a warp+ license key
i mean is it possible?

Getting error when faking referrers

Getting this error again

cf-warp 10
Prepare faking Warp+ referrer for 10 times.
(node:4392) UnhandledPromiseRejectionWarning: SyntaxError: Unexpected token e in JSON at position 0
at JSON.parse ()
at module.exports (C:\Users\ronni\AppData\Roaming\npm\node_modules\cf-warp\lib\register.js:29:14)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async module.exports (C:\Users\ronni\AppData\Roaming\npm\node_modules\cf-warp\lib\ref.js:4:2)
at async C:\Users\ronni\AppData\Roaming\npm\node_modules\cf-warp\cli.js:83:4
(node:4392) 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(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:4392) [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.

Error [ERR_SOCKET_CLOSED]

General information

  • Ubuntu + 20.04LTS:
    • How did you install it?
      sudo npm i -g cf-warp
    • result:
/usr/local/bin/cf-warp -> /usr/local/lib/node_modules/cf-warp/cli.js
+ [email protected]
added 7 packages from 4 contributors in 1.366s

Exact steps to reproduce the problem

  1. sudo npm i -g cf-warp

  2. Open the CLI tool

What should happen?

Everthing Should Have Worked

What happened instead?

(node:25529) UnhandledPromiseRejectionWarning: Error [ERR_SOCKET_CLOSED]: Socket is closed
    at TLSSocket.Socket._writeGeneric (net.js:704:18)
    at TLSSocket.connect (net.js:696:12)
    at Object.onceWrapper (events.js:286:20)
    at TLSSocket.emit (events.js:203:15)
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1093:10)
(node:25529) 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:25529) [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.

Composition file

I am a huge noob, so how can I make a composition file for this? Thanks!

I am running on a Raspberry Pi btw.

No internet access except in telegram app

Basically if I run
wg-quick up cf-warp.conf
I have no internet access, pings fail, but somehow telegram works.
The same conf on android and windows work just fine.
I'm on Pop!OS 20.10, which is based on Ubuntu 20.10
Any idea what could be the problem?
Using latest cf-warp, installed from npm

Using Warp config on WireGuard without 0.0.0.0/0 IP

I use WireGuard on Android, and I imported the Warp config, and it works well. But certain apps and websites say I am using a private proxy, and I find that the problem lies within the Allowed IPsbeing 0.0.0.0/0. The problem is, 0.0.0.0/0 is what allows me to watch YouTube videos with no buffer, any other IP address I tried can't come even close. What can I try to modify to increase receive and transmit speed almost the same way only 0.0.0.0/0can, and at the same time satisfy sites that don't work well with private IPs? The Cloudflare app (when 1.1.1.1, NOT Warp, is enabled) seems to be able to do it.

HTTPError: Too Many Requests

I got this error everytime. I need to change it to "2" and can't run too frequently.

cf-warp 10
Prepare faking Warp+ referrer for 10 times.
#1 fake referrer finished
#2 fake referrer finished
(node:680) UnhandledPromiseRejectionWarning: HTTPError: Too Many Requests
    at responseErrorThrower (/snapshot/cf-warp/node_modules/xfetch-js/xfetch.js:37:22)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async /snapshot/cf-warp/lib/register.js:11:15
    at async /snapshot/cf-warp/lib/ref.js:4:2
    at async /snapshot/cf-warp/cli.js:64:4
(node:680) 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:680) [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.

Command not found

Installed cf-warp through yarn:
success Installed "[email protected]" with binaries:
- cf-warp
Done in 0.74s.

But when I try to run cf-warp, I receive a command not found error.

PS: I'm running Manjaro Linux (Arch).

HTTPError: Forbidden — Unable to create Warp account

Every time I run "cf-warp" command I get "UnhandledPromiseRejectionWarning: HTTPError: Forbidden" error after "Initializing Warp credentials..." message pops up. I tried connecting to different Wi-Fi networks and using various VPNs, but I still get this error.

Could this possibly mean that Cloudflare finally banned cf-warp? I'm using cf-warp with Node 13.13.0 (Yarn 1.22.4) on macOS Catalina.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.