Run Cloudflare WARP in Docker

Cloudflare WARP is a free VPN service provided by Cloudflare. As most service providers consider its exit IP as a reputable residential broadband IP, many people use it for accessing websites that have strict risk control policies, especially when their server’s IP address is not clean. However, when we use it on our own servers, we may encounter the following issues:

  • The official WARP client, in the default mode 1.1.1.1 with WARP, blocks all inbound connections, which means that websites and services on servers cannot be accessed.
  • Although the official WARP client in Local Proxy mode does not have the problem of blocking inbound connections, the HTTPS/SOCKS5 proxy it provides cannot transmit UDP packets.
  • In order to prevent abuse, Cloudflare blocks third-party clients (such as wgcf) from accessing WARP services in some regions, and it is currently unknown whether this measure will be extended to other regions.

This article will run the official WARP client in Docker to solve the above problem.

阅读更多

在 Docker 中运行 Cloudflare WARP

Cloudflare WARP 是 Cloudflare 提供的免费 VPN 服务,由于多数服务商都将其出口 IP 视作信誉良好的家宽 IP,许多人将其用于 IP 地址较脏的服务器,以便访问风控较严格的网站。然而当我们将它在自己的服务器上使用时,会遇到以下的问题:

  • 官方 WARP 客户端在默认模式 1.1.1.1 with WARP 下会阻断所有入站连接,这意味着服务器上的网站和服务都无法被访问
  • 官方 WARP 客户端在 Local Proxy 模式下尽管没有阻断入站连接的问题,其提供的 HTTPS/SOCKS5 代理并不能传输 UDP 数据包
  • 为了防止滥用,Cloudflare 在部分地区阻止了第三方客户端 (wgcf 等) 访问 WARP 服务,暂不清楚它是否会扩大该措施的范围

本文将在 Docker 中运行官方 WARP 客户端,以解决上述问题。

阅读更多

在隔离环境中运行应用的几种方案

在隔离环境中运行应用有诸多好处。在开发时,我们可以通过这种方法防止环境冲突、保证在不同设备上运行时环境一致;在生活中使用软件时,我们可以通过这种方法防止软件对计算机造成破坏。本文讨论了在 Windows 上在隔离环境中运行应用的四种方案:WSL+Docker, Windows Sandbox, Sandboxie 和虚拟机。

阅读更多

搭建基于WSL的开发环境

本文已过时

本文撰写于 2022 年 7 月 8 日,它已经过时。我当前 (2023-07-17) 的开发环境已经和本文中大为不同:

  • 不再使用 socks5 代理而是使用 TUN,这样就不需要对 WSL 进行额外的配置
  • Docker 现在有更好的安装方案,安装一个 Docker 就可以同时在 Windows 和 WSL 上使用,且可以使用开发容器

建议未来的读者在准备 WSL 开发环境时参考微软 WSL 文档的 Tutorials 部分。

更换硬盘并重装了电脑之后,我计划将所有开发环境都放在 Windows Subsystem for Linux (WSL) 上,以避免在 Windows 上遇到依赖地狱。这篇文章介绍了我对基于 WSL 的开发环境的搭建过程。

阅读更多