We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3637900 commit 4eacd64Copy full SHA for 4eacd64
2 files changed
config/caddyfile/example.ps1
@@ -0,0 +1 @@
1
+caddy run --config example.Caddyfile --adapter caddyfile
config/caddyfile/githubProxy.Caddyfile
@@ -0,0 +1,22 @@
+# 对github api 进行反向代理
2
+
3
4
+# 监听本地 33080 端口,反向代理到 GitHub API,并通过本地 7890 代理访问 GitHub
5
+:33080 {
6
+ handle_path /repos/*/* {
7
+ # 提取 owner 和 repo
8
+ @owner_repo path_regexp ^/repos/([^/]+)/([^/]+)/?
9
+ vars owner {re.owner_repo.1}
10
+ vars repo {re.owner_repo.2}
11
+ # 反向代理到 GitHub API,并通过本地 7890 代理
12
+ rewrite * /repos/{http.vars.owner}/{http.vars.repo}
13
+ reverse_proxy https://api.github.com {
14
+ transport http {
15
+ tls
16
+ tls_insecure_skip_verify
17
+ }
18
+ # Add proxy configuration here instead of inside transport
19
+ header_up Host api.github.com
20
21
22
+}
0 commit comments