Yet Another HTTP Proxy Server (yahps): 基于 Bun 的正向代理服务
虽然是写着玩的 但是也要加点功能
▎对上游 30x 重定向添加 allowlist/denylist 校验与代理重写
原消息
服务器合集
频道资源合集
恰饭推荐
群组
#github #加速 #代理 #正向代理
▎对上游 30x 重定向添加 allowlist/denylist 校验与代理重写
- ❤️1
allowlist/denylist 和 userAgentAllowlist/userAgentDenylistproxyPath, 避免根路径 / 直接暴露代理能力localRejectionResponse 响应体,例如返回普通的 404 Not Foundallowlist/denylist 和 userAgentAllowlist/userAgentDenylistproxyPath, 避免根路径 / 直接暴露代理能力localRejectionResponse 响应体,例如返回普通的 404 Not Found
$options 为通过链接传入的参数{ arg1: 'a', arg2: 'b' }encodeURIComponent(JSON.stringify({ arg1: 'a', arg2: 'b' }))
然后这样用 /api/file/foo?$options=%7B%22arg1%22%3A%22a%22%2C%22arg2%22%3A%22b%22%7DencodeURIComponent('arg1=a&arg2=b')/api/file/foo?$options=arg1%3Da%26arg2%3Db{ url: 'https://raw.githubusercontent.com/lige47/QuanX-icon-rule/main/ligeicon.json' }/api/file/fetch?$options=%7B"url"%3A"https%3A%2F%2Fraw.githubusercontent.com%2Flige47%2FQuanX-icon-rule%2Fmain%2Fligeicon.json"%7D$arguments. 但是用的时候, 需要你自己改了.timeout , headers 等参数, 会覆盖默认参数. 也可以直接修改脚本里的默认参数
# > 自己 Gist 的分流
RULE-SET,http://self/direct,DIRECT
# > skk 佬的分流
RULE-SET,http://skk/non_ip/lan,DIRECT
# > bm7 仓库的分流
RULE-SET,http://bm7/Global_All,Proxy
# > 自建服务端 Sub-Store 的组合订阅
订阅 01 = select, policy-path=http://sub/01http://bm7/Global_Allhttps://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Surge/Global/Global_All.listhttp://self/directhttps://gist.githubusercontent.com/your_username/your_gist_id/raw/direct.listhttp://sub/01https://your_sub_store_api.com/xxxxxx/download/collection/01?target=Surge[URL Rewrite]
^http:\/\/bm7\/(.*?)(_.*)?$ https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Surge/$1/$1$2.list 302
^http:\/\/skk\/(.*?)$ https://ruleset.skk.moe/List/$1.conf 302
^http:\/\/self\/(.*)$ https://gist.githubusercontent.com/your_username/your_gist_id/raw/$1.list 302
^http:\/\/sub\/(.*)$ https://your_sub_store_api.com/xxxxxx/download/collection/$1?target=Surge 302RULE-SET,http://❤️🍟/HTTPDNS,Reject^http:\/\/xn--qeiz318m\/HTTPDNS http://raw.githubusercontent.com/VirgilClyne/GetSomeFries/main/ruleset/HTTPDNS.Block.list 302
#!name=GitHub 加速
#!desc=自动使用 mirror.ghproxy.com 加速, 去除 github.com 的 Content-Security-Policy
[URL Rewrite]
^(https?:\/\/(raw\.githubusercontent\.com|gist\.githubusercontent\.com|github\.com\/[^/]+\/[^/]+(\/releases\/download|\/archive))\/.+?)$ https://mirror.ghproxy.com/$1 302
[Header Rewrite]
http-response ^https:\/\/github\.com\/.+?$ header-del Content-Security-Policy
[MITM]
hostname = %APPEND% raw.githubusercontent.com, gist.githubusercontent.com, github.com