惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

WordPress大学
WordPress大学
Martin Fowler
Martin Fowler
Schneier on Security
Schneier on Security
S
Schneier on Security
A
Arctic Wolf
L
LangChain Blog
T
Threatpost
GbyAI
GbyAI
V2EX - 技术
V2EX - 技术
Jina AI
Jina AI
U
Unit 42
P
Proofpoint News Feed
M
MIT News - Artificial intelligence
G
GRAHAM CLULEY
T
The Exploit Database - CXSecurity.com
Spread Privacy
Spread Privacy
F
Fortinet All Blogs
Y
Y Combinator Blog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
C
Cybersecurity and Infrastructure Security Agency CISA
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
月光博客
月光博客
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
F
Full Disclosure
博客园 - 【当耐特】
S
Secure Thoughts
美团技术团队
N
News | PayPal Newsroom
爱范儿
爱范儿
Latest news
Latest news
Microsoft Azure Blog
Microsoft Azure Blog
I
InfoQ
S
Security @ Cisco Blogs
V
V2EX
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
腾讯CDC
The Hacker News
The Hacker News
V
Vulnerabilities – Threatpost
Cyberwarzone
Cyberwarzone
Google Online Security Blog
Google Online Security Blog
N
Netflix TechBlog - Medium
I
Intezer
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
The Last Watchdog
The Last Watchdog
N
News and Events Feed by Topic
T
Tor Project blog
博客园 - 三生石上(FineUI控件)
Security Archives - TechRepublic
Security Archives - TechRepublic
大猫的无限游戏
大猫的无限游戏
Security Latest
Security Latest

Alliot's blog

Docker 代理配置机制与作用域 Docker 代理配置机制与作用域 2025年底的安卓搞机备忘录 2025年底的安卓搞机备忘录 ArgoCD部署应用出现metadata.annotations过大问题 ArgoCD部署应用出现metadata.annotations过大问题 APC UPS更换电池校准容量 APC UPS更换电池校准容量 M1 Mac安装低版本Node.js M1 Mac安装低版本Node.js Ansible使用Bitwarden存储Vault密码 Ansible使用Bitwarden存储Vault密码 Cloudflare Tunnel前置代理支持 CDN场景下配置Vaultwarden启用fail2ban CDN场景下配置Vaultwarden启用fail2ban 中银香港丝滑开户总结 中银香港丝滑开户总结 从指定路径更新雷池WAF证书 从指定路径更新雷池WAF证书 AWS ECS使用EBS作为Volume AWS ECS使用EBS作为Volume 浅浅的调教一下国产智障电视 浅浅的调教一下国产智障电视 Nginx proxy_pass到AWS ALB的504问题 Nginx proxy_pass到AWS ALB的504问题 OpenV**手动指定路由规则 OpenV**手动指定路由规则 本地模拟CNAME解析 本地模拟CNAME解析 Nginx搭建WebDAV服务 Nginx搭建WebDAV服务 迎来船新版本的Hexo+NexT 迎来船新版本的Hexo+NexT 优雅的处理Git多帐号与代理问题 优雅的处理Git多帐号与代理问题 验光配镜扫盲 验光配镜扫盲 Prometheus relabel实现动态metrics path Prometheus relabel实现动态metrics path
Cloudflare Tunnel前置代理支持
Alliot · 2024-09-01 · via Alliot's blog

  赛博大善人的 Cloudflare Tunnel(前 Argo Tunnel) 只需要一个域名、一个 Cloudflare 帐号便可以将服务接入到 Cloudflare 的网络,提供了非常方便的内网穿透方式, 同时还提供了 ZeroTrust、防护等功能, 而这一切基本几乎都是免费的,相信看到此文的小伙伴已经薅上一段时间了,不过由于 Cloudflare Tunnel 官方的服务节点分布有限,在部分时空/场景下,Tunnel 连通性会面临一些挑战, 这时候要是能够通过前置代理去连接到 Tunnel 服务,问题便能得到解决,可惜官方目前并没打算支持这个特性

  目前比较有效的方案是 Xiaomage 同学的: Cloudflare Tunnel速度慢?尝试给它加个前置代理提高速度 ,不过这种方式对动手能力还是有点要求的,同时也增加了部署的依赖。
  这里看到社区有一个来自 Asutorufa 的PR: http2 tunnel support
经过测试,发现基本能实现这个需求。 根据这个思路,Fork 仓库后简单的加了个 GitHub Action 打包发布 Docker 镜像。

  顺便放一个 Docker compose 片段:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
cloudflare-tunnel:
image: ghcr.io/alliottech/cloudflared_proxy:latest

container_name: cloudflare-tunnel
hostname: cloudflare-tunnel
restart: unless-stopped
command: tunnel run --protocol http2
links:
- "nginx"
volumes:
- /etc/localtime:/etc/localtime:ro
environment:
- "all_proxy=socks5://127.0.0.1:123"
- "TUNNEL_TRANSPORT_PROTOCOL=http2"
- "TUNNEL_TOKEN=xxxxxxxx"

  直接替换之前的官方镜像片段为上述后即可愉快的玩耍了, 切记 TUNNEL_TRANSPORT_PROTOCOL=http2 这个环境变量是必须的:

https://github.com/cloudflare/cloudflared/pull/1020#issuecomment-1706843025
This is something that we don’t actually want to support within cloudflared.
Furthermore, http2 transport only has a subset of features that cloudflared allows and the official transport to use should be QUIC, which wouldn’t work for the SOCKS proxy.

  当然,你也可以选择 Clone 仓库后,手动打包二进制直接使用:

1
make cloudflared TARGET_ARCH=amd64 TARGET_OS=linux

使用编译后的 cloudflared:

1
all_proxy=socks5://127.0.0.1:123 ./cloudflared tunnel run --protocol http2

Ref

Cloudflare Tunnel速度慢?尝试给它加个前置代理提高速度
探索Cloudflared Tunnel