Total Pageviews

Saturday, 10 July 2021

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


from https://github.com/maple3142/cf-warp

------

 

域名、CDN、DNS 解析、日志,这些老生常谈的就不多说了

免费版本也同时支持一些 DDoS 防护和 WAF,通过简单的设置即可挡掉绝大多数恶意请求和机器人,还支持限流配置,非常良心

Workers 和 Pages 这些还没用过

这里简单说一下 Zero Trust,目前用得比较多
Zero Trust
什么是 Zero Trust?官方解释:https://www.cloudflare.com/zh-cn/learning/security/glossary/what-is-zero-trust/
利用普通人理解的大白话来说,就是一个 VPN 服务.

WARP

Cloudflare 提供了一个叫做 WARP 的程序,普通用户每次注册就会提供 1G 免费流量,而如果利用一些其他软件刷流量,则可达到无限流量(这个我没有细心研究,目前还没试过刷流量)

而更提供了一种名为 Team 的服务,利用它的 teams-enroll-token 也可实现无限流量,它会提供一个登录页面,并且可以配置指定邮箱才能收到邮件,里面有验证链接,通过后即可直接打开 WARP 客户端

举个实际应用案例:ChatGPT 不久前封禁了一大堆 VPS 的访问,一旦发出请求,全是 Sorry, you have been blocked 之类,这个时候如果利用这个服务,那么如果请求通过这个代理连出去,就能正常访问 ChatGPT 的接口,VPS 得以继续发光发热

为此做了一个镜像配合服务一起使用:linweiyuan/chatgpt-proxy-server-warp

但是,经过我测试,如果利用 Team 账号,虽然说是无限流量,但是经常超过一定流量就连不上,所以我设置成 Free 账号自动检测流量使用情况,超过 1G 了就会自动重新注册

(注意默认情况下开启 Team 账号后,是不允许设置 proxy-mode 的,具体忘记是不是会直接断开链接还是什么报错,反正用布料,需要进入 Settings -> WARP Client -> Device settings 里面设置)

当时这个注册的操作我钻了好久牛角尖,怎么每次使用都是注册,后来释然了,没有关系,能用就行,除非你有刷过无限流量的账号,就可以自己设置进去,但是太麻烦了
Tunnels
还有一个就是 Tunnels,这个是 Cloudflare 提供的内网穿透,在 Access 菜单里.
和 frp 不同的是,不需要一台服务器(P2P 没用过),直接跑一个程序即可,Cloudflare 自动完成域名解析,完后访问域名就可以看到内网服务了,延迟因人而异,尝试下还是不错的..

 

No comments:

Post a Comment