ini 浪涌配置(2.x)

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ini 浪涌配置(2.x)相关的知识,希望对你有一定的参考价值。

[General]
loglevel = notify
skip-proxy = 127.0.0.1, 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12, 100.64.0.0/10, localhost, *.local, ::ffff:0:0:0:0/1, ::ffff:128:0:0:0/1
bypass-tun = 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12

# dns-server = 119.29.29.29,223.5.5.5,114.114.115.115
# external-controller-access = PASSWORD@0.0.0.0:6155
# ipv6 = true

// REMEMBER TO CHANGE THE external-controller-access' PASSWORD

[Proxy]

Direct = direct

// ADD YOUR PROXY BELOW, DON'T FORGET TO REMOVE # , THERE'RE 4 TYPES OF PROXIES, YOU HAVE TO PICK UP THE RIGHT ONES.

# Proxy1 = http,$IP,$PORT,$USERNAME,$PASSWORD
# Proxy2 = https,$IP,$PORT,$USERNAME,$PASSWORD
# Proxy3 = socks,$IP,$PORT,$USERNAME,$PASSWORD
# Proxy4 = custom,$IP,$PORT,$METHOR,$PASSWORD,$MODULE_URL 

// CUSTOM ALMOST MEANS, SHADOWSOCKS. YOU HAVE TO GET THE SHADOWSOCKS MODULE BEFORE USING SHADOWSOCKS PROXY, HERE'S ONE: https://dl.dropboxusercontent.com/u/760466/SSEncrypt.module

// YOU CAN ADD LOTS OF PROXIES HERE.

# [SSID Setting]
# WiFi-SSID-NAME suspend=true

// YOU CAN SUSPEND SURGE ON CERTAIN WIFI

[Proxy Group]

Proxy = select, AutoGroup, Direct, Proxy1, Proxy2, Proxy3, Proxy4, Proxy5, Proxy6, Proxy7

AutoGroup = url-test, Proxy1, Proxy2, Proxy3, Proxy4, Proxy5, Proxy6, Proxy7, url = http://www.gstatic.com/generate_204

# SSID-Group = ssid, default = Proxy1, cellular = Proxy2, WiFi-SSID-NAME1 = Proxy 3 ,WiFi-SSID-NAME2 = DIRECT

// IF YOU WANT TO CHANGE PROXY BASED ON WiFi SSID, REMOVE THE # ABOVE.

[URL Rewrite]
^http://www.kenengba.com https://kenengba.com 302

// 302 REDIRECT

[Rule]

//BLOCK ADS

DOMAIN-SUFFIX,mgid.com,REJECT
DOMAIN-SUFFIX,ad-stir.com,REJECT
DOMAIN-SUFFIX,gssprt.jp,REJECT
DOMAIN-KEYWORD,adlooxtracking.com,REJECT
DOMAIN-SUFFIX,unimhk.com,REJECT
DOMAIN-SUFFIX,adsfactor.net,REJECT
DOMAIN-KEYWORD,gssp.asia,REJECT
DOMAIN-KEYWORD,genieesspv.jp,REJECT
DOMAIN-KEYWORD,criteo.com,REJECT
DOMAIN-SUFFIX,sax.sina.cn,REJECT
DOMAIN-SUFFIX,tanx.com,REJECT
DOMAIN-SUFFIX,ads.genieessp.com,REJECT
DOMAIN-SUFFIX,ad.unimhk.com,REJECT
DOMAIN-SUFFIX,cpro.baidustatic.com,REJECT
DOMAIN-SUFFIX,m.simaba.taobao.com,REJECT
DOMAIN-SUFFIX,ads.yahoo.com,REJECT
DOMAIN-SUFFIX,ib.adnxs.com,REJECT

//NORMAL RULES

DOMAIN-KEYWORD,instagram,Proxy,force-remote-dns
DOMAIN-KEYWORD,blogspot,Proxy,force-remote-dns
DOMAIN-KEYWORD,google,Proxy,force-remote-dns
DOMAIN-KEYWORD,facebook,Proxy,force-remote-dns
DOMAIN-KEYWORD,youtube,Proxy,force-remote-dns
DOMAIN-KEYWORD,twitter,Proxy,force-remote-dns
DOMAIN-KEYWORD,gmail,Proxy,force-remote-dns
DOMAIN-SUFFIX,twimg.com,Proxy,force-remote-dns
DOMAIN-SUFFIX,kenengba.com,Proxy,force-remote-dns

DOMAIN-SUFFIX,cn,DIRECT
DOMAIN-SUFFIX,jd.com,DIRECT
DOMAIN-SUFFIX,yhd.com,DIRECT
DOMAIN-SUFFIX,58cdn.com,DIRECT
DOMAIN-SUFFIX,qunarzz.com,DIRECT
DOMAIN-SUFFIX,avosapps.com,DIRECT
DOMAIN-SUFFIX,mob.com,DIRECT
DOMAIN-SUFFIX,same.com,DIRECT
DOMAIN-SUFFIX,toutiao.com,DIRECT
DOMAIN-SUFFIX,zaih.com,DIRECT
DOMAIN-SUFFIX,lantouzi.com,DIRECT
DOMAIN-SUFFIX,smzdm.com,DIRECT
DOMAIN-SUFFIX,126.net,DIRECT
DOMAIN-SUFFIX,163.com,DIRECT
DOMAIN-SUFFIX,alicdn.com,DIRECT
DOMAIN-SUFFIX,amap.com,DIRECT
DOMAIN-SUFFIX,bdimg.com,DIRECT
DOMAIN-SUFFIX,bdstatic.com,DIRECT
DOMAIN-SUFFIX,cnbeta.com,DIRECT
DOMAIN-SUFFIX,cnzz.com,DIRECT
DOMAIN-SUFFIX,douban.com,DIRECT
DOMAIN-SUFFIX,gtimg.com,DIRECT
DOMAIN-SUFFIX,hao123.com,DIRECT
DOMAIN-SUFFIX,haosou.com,DIRECT
DOMAIN-SUFFIX,ifeng.com,DIRECT
DOMAIN-SUFFIX,iqiyi.com,DIRECT
DOMAIN-SUFFIX,netease.com,DIRECT
DOMAIN-SUFFIX,qhimg.com,DIRECT
DOMAIN-SUFFIX,qq.com,DIRECT
DOMAIN-SUFFIX,sogou.com,DIRECT
DOMAIN-SUFFIX,sohu.com,DIRECT
DOMAIN-SUFFIX,soso.com,DIRECT
DOMAIN-SUFFIX,suning.com,DIRECT
DOMAIN-SUFFIX,tmall.com,DIRECT
DOMAIN-SUFFIX,tudou.com,DIRECT
DOMAIN-SUFFIX,weibo.com,DIRECT
DOMAIN-SUFFIX,youku.com,DIRECT
DOMAIN-SUFFIX,xunlei.com,DIRECT
DOMAIN-SUFFIX,zhihu.com,DIRECT
DOMAIN-SUFFIX,huofu.com,DIRECT
DOMAIN-SUFFIX,5wei.com,DIRECT
DOMAIN-SUFFIX,travelrely.com,DIRECT
DOMAIN-KEYWORD,alipay,DIRECT
DOMAIN-KEYWORD,taobao,DIRECT
DOMAIN-KEYWORD,baidu,DIRECT
DOMAIN-KEYWORD,360buy,DIRECT
DOMAIN-KEYWORD,baidu,DIRECT
DOMAIN-SUFFIX,appldnld.apple.com,DIRECT
DOMAIN-SUFFIX,adcdownload.apple.com,DIRECT
DOMAIN-SUFFIX,lcdn-registration.apple.com,DIRECT
DOMAIN-SUFFIX,swcdn.apple.com,DIRECT
DOMAIN-SUFFIX,phobos.apple.com,DIRECT
DOMAIN-SUFFIX,ls.apple.com,DIRECT
DOMAIN,aod.itunes.apple.com,Proxy
DOMAIN,osxapps.itunes.apple.com,Proxy
DOMAIN,streamingaudio.itunes.apple.com,Proxy
DOMAIN-SUFFIX,icloud.com,Proxy
DOMAIN-SUFFIX,apple.com,Proxy
DOMAIN-SUFFIX,amazonaws.com,Proxy
DOMAIN-SUFFIX,android.com,Proxy
DOMAIN-SUFFIX,angularjs.org,Proxy
DOMAIN-SUFFIX,appspot.com,Proxy
DOMAIN-SUFFIX,akamaihd.net,Proxy
DOMAIN-SUFFIX,amazon.com,Proxy
DOMAIN-SUFFIX,bit.ly,Proxy
DOMAIN-SUFFIX,bitbucket.org,Proxy
DOMAIN-SUFFIX,blog.com,Proxy
DOMAIN-SUFFIX,blogcdn.com,Proxy
DOMAIN-SUFFIX,blogger.com,Proxy
DOMAIN-SUFFIX,blogsmithmedia.com,Proxy
DOMAIN-SUFFIX,box.net,Proxy
DOMAIN-SUFFIX,bloomberg.com,Proxy
DOMAIN-SUFFIX,chromium.org,Proxy
DOMAIN-SUFFIX,cl.ly,Proxy
DOMAIN-SUFFIX,cloudfront.net,Proxy
DOMAIN-SUFFIX,cloudflare.com,Proxy
DOMAIN-SUFFIX,cocoapods.org,Proxy
DOMAIN-SUFFIX,crashlytics.com,Proxy
DOMAIN-SUFFIX,dribbble.com,Proxy
DOMAIN-SUFFIX,dropbox.com,Proxy
DOMAIN-SUFFIX,dropboxstatic.com,Proxy
DOMAIN-SUFFIX,dropboxusercontent.com,Proxy
DOMAIN-SUFFIX,docker.com,Proxy
DOMAIN-SUFFIX,duckduckgo.com,Proxy
DOMAIN-SUFFIX,digicert.com,Proxy
DOMAIN-SUFFIX,dnsimple.com,Proxy
DOMAIN-SUFFIX,edgecastcdn.net,Proxy
DOMAIN-SUFFIX,engadget.com,Proxy
DOMAIN-SUFFIX,eurekavpt.com,Proxy
DOMAIN-SUFFIX,fb.me,Proxy
DOMAIN-SUFFIX,fbcdn.net,Proxy
DOMAIN-SUFFIX,fc2.com,Proxy
DOMAIN-SUFFIX,feedburner.com,Proxy
DOMAIN-SUFFIX,fabric.io,Proxy
DOMAIN-SUFFIX,flickr.com,Proxy
DOMAIN-SUFFIX,fastly.net,Proxy
DOMAIN-SUFFIX,ggpht.com,Proxy
DOMAIN-SUFFIX,github.com,Proxy
DOMAIN-SUFFIX,github.io,Proxy
DOMAIN-SUFFIX,githubusercontent.com,Proxy
DOMAIN-SUFFIX,golang.org,Proxy
DOMAIN-SUFFIX,goo.gl,Proxy
DOMAIN-SUFFIX,gstatic.com,Proxy
DOMAIN-SUFFIX,godaddy.com,Proxy
DOMAIN-SUFFIX,gravatar.com,Proxy
DOMAIN-SUFFIX,imageshack.us,Proxy
DOMAIN-SUFFIX,imgur.com,Proxy
DOMAIN-SUFFIX,jshint.com,Proxy
DOMAIN-SUFFIX,ift.tt,Proxy
DOMAIN-SUFFIX,itunes.com,Proxy
DOMAIN-SUFFIX,j.mp,Proxy
DOMAIN-SUFFIX,kat.cr,Proxy
DOMAIN-SUFFIX,linode.com,Proxy
DOMAIN-SUFFIX,linkedin.com,Proxy
DOMAIN-SUFFIX,licdn.com,Proxy
DOMAIN-SUFFIX,lithium.com,Proxy
DOMAIN-SUFFIX,megaupload.com,Proxy
DOMAIN-SUFFIX,mobile01.com,Proxy
DOMAIN-SUFFIX,modmyi.com,Proxy
DOMAIN-SUFFIX,mzstatic.com,Proxy
DOMAIN-SUFFIX,nytimes.com,Proxy
DOMAIN-SUFFIX,name.com,Proxy
DOMAIN-SUFFIX,openvpn.net,Proxy
DOMAIN-SUFFIX,openwrt.org,Proxy
DOMAIN-SUFFIX,ow.ly,Proxy
DOMAIN-SUFFIX,pinboard.in,Proxy
DOMAIN-SUFFIX,Proxyl-images-amazon.com,Proxy
DOMAIN-SUFFIX,Proxytatic.net,Proxy
DOMAIN-SUFFIX,stackoverflow.com,Proxy
DOMAIN-SUFFIX,staticflickr.com,Proxy
DOMAIN-SUFFIX,squarespace.com,Proxy
DOMAIN-SUFFIX,symcd.com,Proxy
DOMAIN-SUFFIX,symcb.com,Proxy
DOMAIN-SUFFIX,symauth.com,Proxy
DOMAIN-SUFFIX,ubnt.com,Proxy
DOMAIN-SUFFIX,t.co,Proxy
DOMAIN-SUFFIX,thepiratebay.org,Proxy
DOMAIN-SUFFIX,tumblr.com,Proxy
DOMAIN-SUFFIX,twimg.com,Proxy
DOMAIN-SUFFIX,twitch.tv,Proxy
DOMAIN-SUFFIX,twitter.com,Proxy
DOMAIN-SUFFIX,wikipedia.com,Proxy
DOMAIN-SUFFIX,wikipedia.org,Proxy
DOMAIN-SUFFIX,wikimedia.org,Proxy
DOMAIN-SUFFIX,wordpress.com,Proxy
DOMAIN-SUFFIX,wsj.com,Proxy
DOMAIN-SUFFIX,wsj.net,Proxy
DOMAIN-SUFFIX,wp.com,Proxy
DOMAIN-SUFFIX,vimeo.com,Proxy
DOMAIN-SUFFIX,youtu.be,Proxy
DOMAIN-SUFFIX,ytimg.com,Proxy
IP-CIDR,192.168.0.0/16,DIRECT
IP-CIDR,10.0.0.0/8,DIRECT
IP-CIDR,172.16.0.0/12,DIRECT
IP-CIDR,127.0.0.0/8,DIRECT
IP-CIDR,91.108.56.0/22,Proxy,no-resolve
IP-CIDR,91.108.4.0/22,Proxy,no-resolve
IP-CIDR,109.239.140.0/24,Proxy,no-resolve
IP-CIDR,149.154.160.0/20,Proxy,no-resolve
GEOIP,CN,DIRECT
FINAL,Proxy

ini 浪涌配置文件

# 你可以从该 URL 下载这个配置文件: http://surge.run/config-example/ios.conf
# 用编辑器编辑后,再通过 iTunes, URL, AirDrop 或者 iCloud Drive 复制回 iOS 设备
# Version 2.0

[General]
# 日志等级: warning, notify, info, verbose (默认值: notify)
loglevel = notify
# 跳过某个域名或者 IP 段,这些目标主机将不会由 Surge Proxy 处理。(在 macOS 
# 版本中,如果启用了 Set as System Proxy,  那么这些值会被写入到系统网络代理
# 设置中.)
skip-proxy = 127.0.0.1, 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12, 100.64.0.0/10, localhost, *.local
# 强制使用特定的 DNS 服务器
dns-server = 8.8.8.8, 8.8.4.4
# 允许外部控制器访问 Surge, 如 Surge-CLI。
external-controller-access = apassword@127.0.0.1:8888

# 以下参数仅供 iOS 版本使用
# 将系统相关请求交给 Surge TUN 处理,并自动追加规则 
# "IP-CIDR,17.0.0.0/8,DIRECT,no-resolve"
bypass-system = true
# 将特定 IP 段跳过 Surge TUN,详见 Manual
bypass-tun = 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12
# 是否截取并保存 HTTP 流量 (启用后将对性能有较大影响) (默认值: false)
replica = false
# 是否启动完整的 IPv6 支持 (默认值: false)
ipv6 = false

# 以下参数仅供 macOS 版本使用
# 监听地址 (默认值: 127.0.0.1)
interface = 0.0.0.0
# HTTP 服务端口 (默认值: 6152)
port = 6152
# SOCKS5 服务端口 (默认值: 6153)
socks-port = 6153

# 该段定义可用的代理策略
# 针对所有类型代理的选项:
#   interface: 可选 (默认值: null)
#   强制使用特定的出口地址或网络设备 (仅 macOS 版可用)
#   例如: ProxyHTTP = http, 1.2.3.4, 443, username, password, interface = en2
#        en1 = direct, interface = en1
# 针对启用了 TLS 的代理的选项:
#   skip-common-name-verify: "true" 或 "false" (默认值: false)
#   如果启动该选择, Surge 不会校验证书名是否符合.
[Proxy]
ProxyHTTP = http, 1.2.3.4, 443, username, password, skip-common-name-verify=false
ProxyHTTPS = http, 1.2.3.4, 443, username, password, tls=true // 等价于 "https, 1.2.3.4, 443, username, password"
ProxySOCKS5 = socks5, 1.2.3.4, 443, username, password
ProxySOCKS5TLS = socks5, 1.2.3.4, 443, username, password, tls=true

# 该段定义可用的策略组
# 一个策略组可以包括多个子策略. 
# 子策略可以是一个代理策略,或者另一个策略组,或者是一个内置策略 (DIRECT 或 REJECT).
# 有 3 种策略组类型: "select", "url-test" 和 "ssid"
# select: 具体哪个子策略将被使用,由用户界面上进行选择。
# url-test: 具体哪个子策略将被使用,通过测试到具体 URL 的访问速度选择
#   参数:
#   url: 必填
#   测试时用到的目标 URL.
#   interval: 可选, 秒 (默认值: 600s)
#   指定在多长时间后,上次的测试结果将被抛弃。
#   tolerance: 可选, 毫秒 (默认值: 100ms)
#   只有当新的优选线路,比原优选线路的响应时间,大于该值的时候,才会触发线路变更。
#   timeout: 可选, 秒 (默认值: 5s)
#   如果某策略在该时间后依然没有完成,放弃该策略。
# ssid: 具体哪个子策略将被使用,根据 Wi-FI 的 SSID 决定
#   参数:
#   default: 必填
#   默认策略。
#   cellular: 可选
#   在数据网络下的策略。 若不填,那么默认策略将被使用。
[Proxy Group]
SelectGroup = select, ProxyHTTP, ProxyHTTPS, DIRECT, REJECT
AutoTestGroup = url-test, ProxySOCKS5, ProxySOCKS5TLS, url = http://www.google.com/generate_204
SSIDGroup = ssid, default = ProxyHTTP, cellular = ProxyHTTP, SSIDName = ProxySOCKS5

# 该段定义请求处理规则
# 一个规则有三个基础部分:
#          类型,          值,            策略
# 比如:     DOMAIN-SUFFIX,apple.com,     DIRECT
#          IP-CIDR,      192.168.0.0/16,ProxyA
# 有 3 种基于域名的规则: "DOMAIN", "DOMAIN-SUFFIX" 和 "DOMAIN-KEYWORD"
#   参数:
#   force-remote-dns: 可选 (默认值: false)
#   如果某请求被该规则匹配, 且策略不是DIRECT. 那么 DNS 查询将永远在远端代理服务
#   器执行, 即使该请求由 Surge TUN 处理. 
#   更多信息请参见手册.
# 有 2 种基于 IP 的规则: "IP-CIDR" and "GEOIP".
# 如果是一个使用域名进行访问的请求,那么 Surge 将进行 DNS 查询以确认是否应该被
# 该规则匹配. 若 DNS 查询失败,将放弃规则匹配过程并直接给出错误。
#   OPTIONS:
#   no-resolve: 可选 (默认值: false)
#   如果是一个使用域名进行访问的请求,跳过该条规则,不触发 DNS 查询。
[Rule]
DOMAIN-SUFFIX,appldnld.apple.com,DIRECT
DOMAIN-SUFFIX,adcdownload.apple.com,DIRECT
DOMAIN-SUFFIX,swcdn.apple.com,DIRECT
DOMAIN-SUFFIX,phobos.apple.com,DIRECT

DOMAIN-KEYWORD,google,ProxyHTTP,force-remote-dns
DOMAIN-KEYWORD,facebook,SelectGroup
DOMAIN-KEYWORD,blogspot,AutoTestGroup
DOMAIN-KEYWORD,youtube,SSIDGroup

DOMAIN-SUFFIX,apple.com,ProxyHTTPS
DOMAIN-SUFFIX,ad.com,REJECT

IP-CIDR,192.168.0.0/16,DIRECT,no-resolve
IP-CIDR,10.0.0.0/8,DIRECT
IP-CIDR,172.16.0.0/12,DIRECT
IP-CIDR,127.0.0.0/8,DIRECT

GEOIP,CN,DIRECT
FINAL,ProxyHTTP

# 该段定义本地 DNS 记录
# 该功能等同于 /etc/hosts,加上了泛解析和别名支持。
[Host]
abc.com = 1.2.3.4
*.dev = 6.7.8.9
foo.com = bar.com

# 该段定义针对 HTTP 请求的 URL 重定向规则
# 有两种重定向方式: "header" 和 "302"
# 
# Header 模式
# Surge 会修改发出的 http header,必要时还会修改 Host 字段。客户端将
# 感知不到这个重定向过程. 不支持重定向到一个 HTTPS 的地址。
# 
# 302 模式
# Surge 直接简单的返回一个 302 重定向回应。
[URL Rewrite]
^http://www.google.cn http://www.google.com header
^http://yachen.com https://yach.me 302

# 该段仅在 iOS 版本下生效。 
# 你可以为某些特定的 WiFi 网络设置设置参数
# 参数:
# suspend: "true" 或 "false"
# 在该网络下 Surge 将暂停工作。 请注意,如果你在该网络下直接启动 Surge,那么 
# Surge 依然会工作。只有当从其他网络切换到该网络时,Surge 才会暂停。
[SSID Setting]
"SSID Here" suspend=true

以上是关于ini 浪涌配置(2.x)的主要内容,如果未能解决你的问题,请参考以下文章

ini 浪涌配置(2.x)

ini 浪涌配置文件

ini 针对新用户的浪涌配置

ini 浪涌配置

ini 浪涌配置

ini 浪涌配置