Windows 中的 excludedportrange 和 dynamicport

你在使用 Windows 时是否会遇到这样的问题:某个端口在 netstat -ano 中并没有显示被占用,但是即使使用管理员权限仍然无权绑定该端口?这是因为 Windows 有一些端口是被保留的,即 excludedportrange,而该问题可以通过调整 dynamicport 解决。

阅读更多

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 客户端,以解决上述问题。

阅读更多

使用 Deploy key 将私有 GitHub 仓库克隆到境内服务器

由于某些原因,我们往往无法直接在境内服务器上克隆 GitHub 上的仓库。对于公开仓库,我们可以通过公益或自建的反向代理来解决这个问题。但是当我们希望将仓库保持私有时,我们遇到了以下几个问题:

  1. 我们不希望将自己的凭据上传到服务器,因此需要使用权限较低的 personal access token
  2. 很多反向代理方式,尤其是公益的,并不支持传递 personal access token
  3. 在服务器上使用 personal access token 配合反向代理进行 HTTPS clone 将会向反向代理服务器暴露该 token

本文将通过转发 GitHub 的 SSH 端口并使用 Deploy key 来解决这些问题。使用该方案,服务器上的凭据将仅限于读取指定仓库,且中间人无法获得你的凭据。

阅读更多

Cloudflare Tunnel 速度测试

本文撰写于 2022 年 2 月 6 日,文章中的内容具有时效性,当你看到这篇文章时它可能已经过时。

2021年4月,Cloudflare 宣布其旗下的服务 Cloudflare Tunnel 免费开放Cloudflare Tunnel 可以在服务器和 Cloudflare 全球网络之间建立连接,使得服务器在不打开任何防火墙入站规则(甚至可以没有公网IP)的情况下得以被公网访问。这一技术可以应用于内网穿透、保护服务器安全性等领域。

网络上已经有很多关于 Cloudflare Tunnel 的使用教程,但截至本文章发布,我并没有找到延迟和速度测试。因此我自己分别对上海和香港的服务器进行了测试并发布在这里。

阅读更多

urllib3 1.26与代理冲突问题解决

在使用 urllib31.26.0 以上版本时可能出现问题:

ValueError: check_hostname requires server_hostname

此问题可能出现在运行 condapip 等任何需要 urllib3 的命令和程序中。

本文章将描述在不回退 urllib3 的版本的情况下如何解决此问题。

环境

  • windows 10
  • python 3.8.8
  • urllib3 1.26.4
阅读更多

个人博客建立过程记录

今天是我的19岁生日,搭建了一个个人博客,就当作送给自己的生日礼物吧。

这篇文章会介绍一下我为什么要搭建博客、我是如何搭建的、这个博客的未来

阅读更多