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

推荐订阅源

B
Blog RSS Feed
C
CERT Recently Published Vulnerability Notes
P
Proofpoint News Feed
Y
Y Combinator Blog
T
The Blog of Author Tim Ferriss
云风的 BLOG
云风的 BLOG
H
Help Net Security
Recorded Future
Recorded Future
The Register - Security
The Register - Security
F
Full Disclosure
N
Netflix TechBlog - Medium
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
酷 壳 – CoolShell
酷 壳 – CoolShell
H
Hackread – Cybersecurity News, Data Breaches, AI and More
爱范儿
爱范儿
Security Archives - TechRepublic
Security Archives - TechRepublic
Simon Willison's Weblog
Simon Willison's Weblog
Cisco Talos Blog
Cisco Talos Blog
I
InfoQ
T
Tenable Blog
T
Tor Project blog
人人都是产品经理
人人都是产品经理
D
DataBreaches.Net
NISL@THU
NISL@THU
Google DeepMind News
Google DeepMind News
博客园 - 叶小钗
B
Blog
V
V2EX
Jina AI
Jina AI
L
LangChain Blog
月光博客
月光博客
W
WeLiveSecurity
U
Unit 42
AWS News Blog
AWS News Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
博客园 - 聂微东
V
Visual Studio Blog
A
Arctic Wolf
T
Tailwind CSS Blog
The Cloudflare Blog
SecWiki News
SecWiki News
S
SegmentFault 最新的问题
Hacker News - Newest:
Hacker News - Newest: "LLM"
宝玉的分享
宝玉的分享
MyScale Blog
MyScale Blog
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
S
Securelist
www.infosecurity-magazine.com
www.infosecurity-magazine.com
腾讯CDC
雷峰网
雷峰网

Alliot's blog

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