免責事項
以下は、私が個人的にSurgeを使用する中で、より良い使用体験を得るために行ったいくつかのカスタマイズ設定であり、参考として提供します。
その一部はSukkaW氏の設定ガイドおよびルールグループを参考にしており、ここに感謝の意を表します。
以下の設定がお使いのデバイスでうまく動作しない可能性も排除できませんので、ご自身で試行および修正を行ってください。
また:正規版をサポートしてください。
Generalセクション
skip-proxy = 127.0.0.0/8, 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12, 100.64.0.0/10, 162.14.0.0/16, 211.99.96.0/19, 162.159.192.0/24, 162.159.193.0/24, 162.159.195.0/24, fc00::/7, fe80::/10, localhost, *.local, captive.apple.com, passenger.t3go.cn, *.ccb.com, wxh.wo.cn, *.abcchina.com, *.abcchina.com.cn, *.ccb.com.cn
ローカルIPおよび一般的なソフトウェアのプロキシ検出ドメインをスキップ
hijack-dns = 8.8.8.8:53, 8.8.4.4:53
Google DNSリクエストをハイジャックし、Google系製品がSurgeプロキシを経由しないことを回避
ipv6 = false
ipv6-vif = disabled
プロキシソフトウェアにとって、IPv6はまだ不完全であるため、現時点ではオフにしておくことをお勧めします
exclude-simple-hostnames = true
show-error-page-for-reject = true
read-etc-hosts = true
localhostなどがプロキシをバイパス、インターセプト時にエラーページを表示、システムのhostsを読み込む
internet-test-url = http://connectivitycheck.platform.hicloud.com/generate_204
proxy-test-url = http://latency-test.skk.moe/endpoint
proxy-test-udp = [email protected]
レイテンシおよびUDPテストURL。SukkaW氏の小テストツールをお勧めします
dns-server = system
DNS設定。DNSハイジャックが特に深刻でない限り、最適な解決を得るためにデフォルトを使用することをお勧めします
force-http-engine-hosts = www.google.cn:80
SurgeにTCP接続をHTTPリクエストとして扱わせることで、Macのゲートウェイモードで他のデバイスからのgoogle.cnリクエストを書き換えることができます
udp-policy-not-supported-behaviour = REJECT
UDP転送をサポートしないプロキシの後続操作。接続漏洩を防ぐためにREJECTを使用することをお勧めします
General設定の統合は以下の通りです:
[General]
skip-proxy = 127.0.0.0/8, 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12, 100.64.0.0/10, 162.14.0.0/16, 211.99.96.0/19, 162.159.192.0/24, 162.159.193.0/24, 162.159.195.0/24, fc00::/7, fe80::/10, localhost, *.local, captive.apple.com, passenger.t3go.cn, *.ccb.com, wxh.wo.cn, *.abcchina.com, *.abcchina.com.cn, *.ccb.com.cn
hijack-dns = 8.8.8.8:53, 8.8.4.4:53
ipv6 = false
ipv6-vif = disabled
exclude-simple-hostnames = true
show-error-page-for-reject = true
read-etc-hosts = true
internet-test-url = http://connectivitycheck.platform.hicloud.com/generate_204
proxy-test-url = http://latency-test.skk.moe/endpoint
proxy-test-udp = [email protected]
dns-server = system
force-http-engine-hosts = www.google.cn:80
udp-policy-not-supported-behaviour = REJECT
ProxyおよびProxy Groupセクション
このセクションは主に自身のサーバーセットとトラフィック分割ルールが中心であり、自分の使用習慣に最も適したものが最良の設定です。
私個人は複雑なポリシーグループの選択が好きではなく、その必要性もありません。トラフィック分割ルールについてはGithubを参照してください。
また:Surgeの最新機能であるSmartポリシーグループの使用をお勧めします。これにより、ポリシーグループの可用性テストに対する懸念を大幅に軽減できます。
Ruleセクション
[Rule]
DOMAIN-SET,https://ruleset.skk.moe/List/domainset/reject.conf,REJECT,extended-matching //广告拦截
RULE-SET,https://ruleset.skk.moe/List/non_ip/reject.conf,REJECT,extended-matching //广告拦截
RULE-SET,https://ruleset.skk.moe/List/ip/reject.conf,REJECT-DROP //广告拦截
RULE-SET,https://ruleset.skk.moe/List/non_ip/reject-no-drop.conf,REJECT-NO-DROP,extended-matching //广告拦截
RULE-SET,https://ruleset.skk.moe/List/non_ip/reject-drop.conf,REJECT-DROP,extended-matching //广告拦截
DOMAIN-SET,https://ruleset.skk.moe/List/domainset/cdn.conf,Proxy,extended-matching //国外CDN
RULE-SET,https://ruleset.skk.moe/List/non_ip/ai.conf,Proxy,extended-matching //AI相关服务,可换成自己的策略组名称
RULE-SET,https://ruleset.skk.moe/List/non_ip/global.conf,Proxy,extended-matching //常见国际网站
RULE-SET,https://ruleset.skk.moe/List/non_ip/domestic.conf,DIRECT,extended-matching //常见国内网站
RULE-SET,https://ruleset.skk.moe/List/non_ip/lan.conf,DIRECT //本地服务
RULE-SET,https://ruleset.skk.moe/List/ip/telegram.conf,Proxy //Telegram
PROCESS-NAME,Telegram,REJECT-DROP //Telegram,结合上一条使用
RULE-SET,https://ruleset.skk.moe/List/ip/lan.conf,DIRECT //本地服务-ip
RULE-SET,https://ruleset.skk.moe/List/non_ip/direct.conf,DIRECT,extended-matching //直连的服务
RULE-SET,https://ruleset.skk.moe/List/ip/domestic.conf,DIRECT //常见国内ip
RULE-SET,https://ruleset.skk.moe/List/ip/china_ip.conf,DIRECT //国内ip
FINAL,Proxy,dns-failed //回退
RuleフィールドはSukkaW氏のルールグループを使用しており、自身の実際の状況に合わせて削減を行いました。詳細はSukkaWをご覧ください。
Hostセクション
github.com = server:1.1.1.1 // Github
*.github.com = server:1.1.1.1 // Github
*.githubusercontent.com = server:1.1.1.1 // Github
現在、国内の多くのキャリアがGithubに対してDNS汚染を行っているため、上記の設定ではGithubのURLに1.1.1.1のDNS解決を使用しています。
MITM&Script
MITMおよびスクリプト機能は主に個人のニーズによります。スクリプトの検索についてはNobyDa氏のTGチャンネルをフォローしてください。
以下は私が現在使用しているいくつかのスクリプトであり、参考にしてください。
Ali-Point = type=cron,cronexp="0 6,13 * * *",timeout=600,script-path=https://raw.githubusercontent.com/leiyiyan/resource/main/script/aliyun_web/aliyun_web.js,script-update-interval=259200
AliYun_Checkin = type=cron,cronexp=44 6 * * *,script-path=https://gist.githubusercontent.com/Sliverkiss/33800a98dcd029ba09f8b6fc6f0f5162/raw/aliyun.js,script-update-interval=259200,timeout=600
Amap_Checkin = type=cron,cronexp=47 6 * * *,timeout=60,script-path=https://raw.githubusercontent.com/wf021325/qx/master/task/ampDache.js,script-update-interval=259200
Longfor_Checkin = type=cron,cronexp=42 6 * * *,script-path=https://raw.githubusercontent.com/leiyiyan/resource/main/script/lhtj/lhtj.js,script-update-interval=259200,timeout=120
Ali_Points = type=http-response,pattern=^https?:\/\/developer\.aliyun\.com\/developer\/api\/my\/user\/getUser,requires-body=1,max-size=0,binary-body-mode=0,timeout=60,script-path=https://raw.githubusercontent.com/leiyiyan/resource/main/script/aliyun_web/aliyun_web.js,script-update-interval=259200
# AliYun_Cookie = type=http-request,pattern=^https:\/\/(auth|aliyundrive)\.alipan\.com\/v2\/account\/token,requires-body=1,max-size=0,binary-body-mode=0,script-path=https://gist.githubusercontent.com/Sliverkiss/33800a98dcd029ba09f8b6fc6f0f5162/raw/aliyun.js,script-update-interval=259200
# Amap_Cookie = type=http-response,pattern=^https:\/\/(m5(|-zb)|dache)\.amap\.com\/(ws\/yuece\/(act|openapi\/activity\/current)\/query|common\/(alipaymini|wxmini)\?_ENCRYPT=),requires-body=1,max-size=0,binary-body-mode=0,script-path=https://raw.githubusercontent.com/wf021325/qx/master/task/ampDache.js,script-update-interval=0
# Longfor_Cookie = script-path=https://raw.githubusercontent.com/leiyiyan/resource/main/script/lhtj/lhtj.js,timeout=60,tag=龙湖天街获取Cookie,type=http-request,pattern=^https?:\/\/gw2c\-hw\-open\.longfor\.com\/lmarketing\-task\-api\-mvc\-prod\/openapi\/task\/v1\/signature\/clock,requires-body=0,script-update-interval=0
それぞれ阿里雲サインインスクリプト、阿里雲盤サインイン、高徳配車サインイン、龍湖天街サインインであり、下の4つはCookie取得スクリプトです。
対応するhostnameを追加する必要があります:
hostname = developer.aliyun.com, *.amap.com, auth.alipan.com, auth.aliyundrive.com, gw2c-hw-open.longfor.com
モジュール
LoonKissSurge Repositoryを参照し、必要なモジュールをご自身で選択してください。各氏の無私の奉献に感謝します。
広電ネットワーク向け特殊設定
広電ネットワークのインフラは不完全であるため、WeChatを使用する際に「接続中」や「受信中」のまま長時間読み込み状態になる可能性が高いです。以下の設定はテスト済みであり、有効に改善できます。
ゴミ広電、すでに解約して、もっとネットワークが悪い聯通に変えた
AND,((SUBNET,TYPE:CELLULAR), (OR,((PROTOCOL,UDP), (PROTOCOL,QUIC))), (DEST-PORT,443)),REJECT-NO-DROP
上記を[Rule]に追加し、443ポートのすべてのUDPおよびQUICリクエストを破棄
*.qq.com = server:101.226.4.6 // QQ
*.qlogo.cn = server:101.226.4.6 // 腾讯头像
*.qpic.cn = server:101.226.4.6 // 腾讯图片
*.weixin.qq.com = server:101.226.4.6 // 微信
*.wx.qq.com = server:101.226.4.6 // 微信
*.weixin.com = server:101.226.4.6 // 微信
*.weixinbridge.com = server:101.226.4.6 // 微信公众平台
*.wechat.com = server:101.226.4.6 // WeChat
*.servicewechat.com = server:101.226.4.6 // 微信小程序
上記を[Host]に追加し、WeChat関連ドメインを360DNSを使用して解決
以上はテスト済みの使用可能な設定であり、WeChatの読み込み中の問題を大幅に改善できます。より良い設定があれば、コメントで共有していただければ幸いです。