Skip to content

Instantly share code, notes, and snippets.

@owen233
Forked from janlay/README.md
Created June 5, 2016 08:21
Show Gist options
  • Select an option

  • Save owen233/23318a8cc5e9aee95d0ca706f6c4d9a1 to your computer and use it in GitHub Desktop.

Select an option

Save owen233/23318a8cc5e9aee95d0ca706f6c4d9a1 to your computer and use it in GitHub Desktop.

Revisions

  1. @janlay janlay revised this gist May 12, 2016. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions rules-main.txt
    Original file line number Diff line number Diff line change
    @@ -32,6 +32,7 @@ DOMAIN-KEYWORD, facebook, Proxy, force-remote-dns
    DOMAIN-KEYWORD, gmail, Proxy, force-remote-dns
    DOMAIN-KEYWORD, google, Proxy, force-remote-dns
    DOMAIN-KEYWORD, youtube, Proxy, force-remote-dns
    DOMAIN-SUFFIX, fbcdn.net, Proxy, force-remote-dns
    DOMAIN-SUFFIX, twitter.com, Proxy, force-remote-dns
    DOMAIN-SUFFIX, twimg.com, Proxy, force-remote-dns
    DOMAIN-SUFFIX, github.com, Proxy, force-remote-dns
  2. @janlay janlay revised this gist May 9, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion config.txt
    Original file line number Diff line number Diff line change
    @@ -4,7 +4,7 @@ interface = 127.0.0.1
    port = 8800
    loglevel = warning
    bypass-tun = 192.168.0.0/16, 10.0.0.0/8, 172.0.0.0/8, 100.64.0.0/10
    skip-proxy = 192.168.0.0/16, 10.0.0.0/8, 172.0.0.0/8, 100.64.0.0/10, localhost, *.local, e.crashlytics.com
    skip-proxy = 192.168.0.0/16, 10.0.0.0/8, 172.0.0.0/8, 100.64.0.0/10, localhost, *.local, ::ffff:0:0:0:0/1, ::ffff:128:0:0:0/1, e.crashlytics.com
    # dns-server = 119.29.29.29, 223.5.5.5, 114.114.114.114

    [Host]
  3. @janlay janlay revised this gist May 6, 2016. 1 changed file with 4 additions and 0 deletions.
    4 changes: 4 additions & 0 deletions rules-app-blockers.txt
    Original file line number Diff line number Diff line change
    @@ -29,5 +29,9 @@ DOMAIN, lives.l.qq.com, REJECT

    # Disable customized fonts
    DOMAIN, fonts.googleapis.com, REJECT

    # Awful ads served by China Telecom
    DOMAIN, 61.160.200.252, REJECT

    # Prevent sniffer from a public WiFi
    DOMAIN, init.icloud-analysis.com, REJECT
  4. @janlay janlay revised this gist Mar 3, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion config.txt
    Original file line number Diff line number Diff line change
    @@ -13,4 +13,4 @@ skip-proxy = 192.168.0.0/16, 10.0.0.0/8, 172.0.0.0/8, 100.64.0.0/10, localhost,
    ^http://www.google.cn http://www.google.com

    [Proxy]
    #include #include https://gist.github.com/janlay/b57476c72a93b7e622a6/raw/proxy.txt
    #include proxy.txt
  5. @janlay janlay revised this gist Mar 3, 2016. 14 changed files with 69 additions and 45 deletions.
    1 change: 1 addition & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -2,6 +2,7 @@
    1. Modify index.txt with your output path and proxy info
    2. Use [Text Builder](https://github.com/janlay/text-builder) to build configuration for Surge:
    `$ text-builder -index /path/to/index.txt`
    Or run `$ sh build-all` to build all your index files.
    3. Import configuration via AirDrop/iTunes/Dropbox/iCloud


    9 changes: 9 additions & 0 deletions build-all
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    #!/usr/bin/env sh

    # Written by janlay, [email protected]

    for file in ./index-*.txt
    do
    echo "Building file $file..."
    text-builder -index $file
    done
    9 changes: 9 additions & 0 deletions general.txt → config.txt
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,16 @@
    [General]
    # used by Surge for Mac
    interface = 127.0.0.1
    port = 8800
    loglevel = warning
    bypass-tun = 192.168.0.0/16, 10.0.0.0/8, 172.0.0.0/8, 100.64.0.0/10
    skip-proxy = 192.168.0.0/16, 10.0.0.0/8, 172.0.0.0/8, 100.64.0.0/10, localhost, *.local, e.crashlytics.com
    # dns-server = 119.29.29.29, 223.5.5.5, 114.114.114.114

    [Host]

    [URL Rewrite]
    ^http://www.google.cn http://www.google.com

    [Proxy]
    #include #include https://gist.github.com/janlay/b57476c72a93b7e622a6/raw/proxy.txt
    7 changes: 7 additions & 0 deletions index-ios
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    # Surge config index file for iOS 9+
    #output 🚦 Auto Split Traffic.conf
    #include https://gist.github.com/janlay/b57476c72a93b7e622a6/raw/config.txt

    [Rule]
    #include https://gist.github.com/janlay/b57476c72a93b7e622a6/raw/rules-app-blockers.txt
    #include https://gist.github.com/janlay/b57476c72a93b7e622a6/raw/rules-main.txt
    10 changes: 10 additions & 0 deletions index-mac
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,10 @@
    # Surge config index file for Mac OS X 10.11+
    # !Use your username here
    #output /Users/janlay/.surge.conf
    #include https://gist.github.com/janlay/b57476c72a93b7e622a6/raw/config.txt

    [Rule]
    #include https://gist.github.com/janlay/b57476c72a93b7e622a6/raw/rules-intranet.txt
    #include https://gist.github.com/janlay/b57476c72a93b7e622a6/raw/rules-mac-blockers.txt
    #include https://gist.github.com/janlay/b57476c72a93b7e622a6/raw/rules-main.txt

    24 changes: 0 additions & 24 deletions index.txt
    Original file line number Diff line number Diff line change
    @@ -1,24 +0,0 @@
    #output Surge.conf
    [General]
    #include https://gist.github.com/janlay/b57476c72a93b7e622a6/raw/general.txt

    [URL Rewrite]
    #include https://gist.github.com/janlay/b57476c72a93b7e622a6/raw/urlrewrite.txt

    [Proxy]
    # Direct connection
    Direct All = direct
    # Use your own proxy info here
    Proxy1 = http, 1.2.3.4, 1234
    Proxy2 = http, 1.2.3.4, 1234
    Proxy3 = http, 1.2.3.4, 1234

    [Proxy Group]
    Proxy = select, Direct All, Proxy1, Proxy2, Proxy3

    [Rule]
    #include https://gist.github.com/janlay/b57476c72a93b7e622a6/raw/rules-app-blockers.txt
    #include https://gist.github.com/janlay/b57476c72a93b7e622a6/raw/rules-main.txt
    #include https://gist.github.com/janlay/b57476c72a93b7e622a6/raw/rules-apps.txt
    #include https://gist.github.com/janlay/b57476c72a93b7e622a6/raw/rules-lan.txt
    #include https://gist.github.com/janlay/b57476c72a93b7e622a6/raw/rules-final.txt
    5 changes: 5 additions & 0 deletions proxy.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    💊 Play with GFW = direct
    🇯🇵 SSLedge TYO1 = custom <<<

    [Proxy Group]
    Proxy = select, 💊 Play with GFW, 🇯🇵 SSLedge TYO1
    1 change: 1 addition & 0 deletions rules-app-blockers.txt
    Original file line number Diff line number Diff line change
    @@ -7,6 +7,7 @@ DOMAIN, pagead2.googlesyndication.com, REJECT
    DOMAIN, pingma.qq.com, REJECT
    DOMAIN, stat.m.jd.com, REJECT
    DOMAIN-KEYWORD, cnzz, REJECT
    DOMAIN-KEYWORD, analytics., REJECT
    DOMAIN-KEYWORD, flurry.co, REJECT
    DOMAIN-KEYWORD, umeng.co, REJECT
    DOMAIN-SUFFIX, 127.net, REJECT
    10 changes: 0 additions & 10 deletions rules-apps.txt
    Original file line number Diff line number Diff line change
    @@ -1,10 +0,0 @@
    # Workaround for some apps
    # Instagram
    DOMAIN-KEYWORD, instagram, Proxy, force-remote-dns
    # SeekingAlpha
    DOMAIN-SUFFIX, seekingalpha.com, DIRECT
    # Telegram
    IP-CIDR, 109.239.140.0/24, Proxy, no-resolve
    IP-CIDR, 149.154.160.0/20, Proxy, no-resolve
    IP-CIDR, 91.108.4.0/22, Proxy, no-resolve
    IP-CIDR, 91.108.56.0/22, Proxy, no-resolve
    4 changes: 0 additions & 4 deletions rules-final.txt
    Original file line number Diff line number Diff line change
    @@ -1,4 +0,0 @@
    # Detect local network
    GEOIP, CN, DIRECT
    # Use proxy for all others
    FINAL, Proxy
    4 changes: 4 additions & 0 deletions rules-intranet.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,4 @@
    # Special rules for your intranet
    DOMAIN, order.mi.com, Proxy
    DOMAIN, pan.baidu.com, Proxy
    DOMAIN-SUFFIX, 115.com, Proxy
    6 changes: 0 additions & 6 deletions rules-lan.txt
    Original file line number Diff line number Diff line change
    @@ -1,6 +0,0 @@
    # Reserved networks, debugging rules should place above this line
    IP-CIDR, 10.0.0.0/8, DIRECT
    IP-CIDR, 100.64.0.0/10, DIRECT
    IP-CIDR, 127.0.0.0/8, DIRECT
    IP-CIDR, 172.0.0.0/8, DIRECT
    IP-CIDR, 192.168.0.0/16, DIRECT
    23 changes: 23 additions & 0 deletions rules-main.txt
    Original file line number Diff line number Diff line change
    @@ -35,3 +35,26 @@ DOMAIN-KEYWORD, youtube, Proxy, force-remote-dns
    DOMAIN-SUFFIX, twitter.com, Proxy, force-remote-dns
    DOMAIN-SUFFIX, twimg.com, Proxy, force-remote-dns
    DOMAIN-SUFFIX, github.com, Proxy, force-remote-dns

    # Workaround for some apps
    # Instagram
    DOMAIN-KEYWORD, instagram, Proxy, force-remote-dns
    # SeekingAlpha
    DOMAIN-SUFFIX, seekingalpha.com, DIRECT
    # Telegram
    IP-CIDR, 109.239.140.0/24, Proxy, no-resolve
    IP-CIDR, 149.154.160.0/20, Proxy, no-resolve
    IP-CIDR, 91.108.4.0/22, Proxy, no-resolve
    IP-CIDR, 91.108.56.0/22, Proxy, no-resolve

    # Reserved networks, debugging rules should place above this line
    IP-CIDR, 10.0.0.0/8, DIRECT
    IP-CIDR, 100.64.0.0/10, DIRECT
    IP-CIDR, 127.0.0.0/8, DIRECT
    IP-CIDR, 172.0.0.0/8, DIRECT
    IP-CIDR, 192.168.0.0/16, DIRECT

    # Detect local network
    GEOIP, CN, DIRECT
    # Use proxy for all others
    FINAL, Proxy
    1 change: 0 additions & 1 deletion urlrewrite.txt
    Original file line number Diff line number Diff line change
    @@ -1 +0,0 @@
    ^http://www.google.cn http://www.google.com
  6. @janlay janlay revised this gist Mar 1, 2016. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions general.txt
    Original file line number Diff line number Diff line change
    @@ -2,5 +2,6 @@
    interface = 127.0.0.1
    port = 8800
    loglevel = warning
    bypass-tun = 192.168.0.0/16, 10.0.0.0/8, 172.0.0.0/8, 100.64.0.0/10
    skip-proxy = 192.168.0.0/16, 10.0.0.0/8, 172.0.0.0/8, 100.64.0.0/10, localhost, *.local, e.crashlytics.com
    # dns-server = 119.29.29.29, 223.5.5.5, 114.114.114.114
  7. @janlay janlay revised this gist Feb 25, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion index.txt
    Original file line number Diff line number Diff line change
    @@ -3,7 +3,7 @@
    #include https://gist.github.com/janlay/b57476c72a93b7e622a6/raw/general.txt

    [URL Rewrite]
    #include https://gist.github.com/janlay/b57476c72a93b7e622a6/raw//general.txt
    #include https://gist.github.com/janlay/b57476c72a93b7e622a6/raw/urlrewrite.txt

    [Proxy]
    # Direct connection
  8. @janlay janlay revised this gist Feb 25, 2016. 1 changed file with 8 additions and 1 deletion.
    9 changes: 8 additions & 1 deletion index.txt
    Original file line number Diff line number Diff line change
    @@ -6,8 +6,15 @@
    #include https://gist.github.com/janlay/b57476c72a93b7e622a6/raw//general.txt

    [Proxy]
    # Direct connection
    Direct All = direct
    # Use your own proxy info here
    Proxy = http, 1.2.3.4, 1234
    Proxy1 = http, 1.2.3.4, 1234
    Proxy2 = http, 1.2.3.4, 1234
    Proxy3 = http, 1.2.3.4, 1234

    [Proxy Group]
    Proxy = select, Direct All, Proxy1, Proxy2, Proxy3

    [Rule]
    #include https://gist.github.com/janlay/b57476c72a93b7e622a6/raw/rules-app-blockers.txt
  9. @janlay janlay revised this gist Feb 25, 2016. 2 changed files with 4 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions index.txt
    Original file line number Diff line number Diff line change
    @@ -2,6 +2,9 @@
    [General]
    #include https://gist.github.com/janlay/b57476c72a93b7e622a6/raw/general.txt

    [URL Rewrite]
    #include https://gist.github.com/janlay/b57476c72a93b7e622a6/raw//general.txt

    [Proxy]
    # Use your own proxy info here
    Proxy = http, 1.2.3.4, 1234
    1 change: 1 addition & 0 deletions urlrewrite.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    ^http://www.google.cn http://www.google.com
  10. @janlay janlay revised this gist Feb 17, 2016. 1 changed file with 21 additions and 0 deletions.
    21 changes: 21 additions & 0 deletions rules-mac-blockers.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,21 @@
    # Block privacy tracker within apps
    DOMAIN, ads.mopub.com, REJECT
    DOMAIN, cpro.baidu.com, REJECT
    DOMAIN, monitor.uu.qq.com, REJECT
    DOMAIN, pagead2.googlesyndication.com, REJECT
    DOMAIN, pingma.qq.com, REJECT
    DOMAIN-KEYWORD, cnzz, REJECT
    DOMAIN-KEYWORD, flurry.co, REJECT
    DOMAIN-KEYWORD, umeng.co, REJECT
    DOMAIN-SUFFIX, applovin.com, REJECT
    DOMAIN-SUFFIX, beacon.qq.com, REJECT
    DOMAIN-SUFFIX, doubleclick.net, REJECT
    DOMAIN-SUFFIX, mmstat.com, REJECT
    DOMAIN-SUFFIX, mob.com, REJECT
    DOMAIN-SUFFIX, sponsorpay.com, REJECT
    DOMAIN-SUFFIX, youmi.net, REJECT

    # Disable customized fonts
    DOMAIN, fonts.googleapis.com, REJECT
    # Prevent sniffer from a public WiFi
    DOMAIN, init.icloud-analysis.com, REJECT
  11. @janlay janlay revised this gist Feb 16, 2016. 1 changed file with 4 additions and 1 deletion.
    5 changes: 4 additions & 1 deletion rules-main.txt
    Original file line number Diff line number Diff line change
    @@ -9,6 +9,8 @@ DOMAIN-SUFFIX, gtimg.com, DIRECT
    DOMAIN-SUFFIX, jd.com, DIRECT
    DOMAIN-SUFFIX, netease.com, DIRECT
    DOMAIN-SUFFIX, qq.com, DIRECT
    DOMAIN-SUFFIX, live.com, DIRECT
    DOMAIN-SUFFIX, microsoft.com, DIRECT

    # Some services are available locally
    DOMAIN-SUFFIX, ls.apple.com, DIRECT
    @@ -29,6 +31,7 @@ DOMAIN-KEYWORD, sohu, DIRECT
    DOMAIN-KEYWORD, facebook, Proxy, force-remote-dns
    DOMAIN-KEYWORD, gmail, Proxy, force-remote-dns
    DOMAIN-KEYWORD, google, Proxy, force-remote-dns
    DOMAIN-KEYWORD, twitter, Proxy, force-remote-dns
    DOMAIN-KEYWORD, youtube, Proxy, force-remote-dns
    DOMAIN-SUFFIX, twitter.com, Proxy, force-remote-dns
    DOMAIN-SUFFIX, twimg.com, Proxy, force-remote-dns
    DOMAIN-SUFFIX, github.com, Proxy, force-remote-dns
  12. @janlay janlay revised this gist Dec 14, 2015. 2 changed files with 2 additions and 1 deletion.
    2 changes: 1 addition & 1 deletion index.txt
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    #output /Users/janlay/Library/Mobile Documents/com~apple~CloudDocs/Surge.conf
    #output Surge.conf
    [General]
    #include https://gist.github.com/janlay/b57476c72a93b7e622a6/raw/general.txt

    1 change: 1 addition & 0 deletions rules-app-blockers.txt
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,7 @@
    # Block privacy tracker within apps
    DOMAIN, ads.mopub.com, REJECT
    DOMAIN, cpro.baidu.com, REJECT
    DOMAIN, hmma.baidu.com, REJECT
    DOMAIN, monitor.uu.qq.com, REJECT
    DOMAIN, pagead2.googlesyndication.com, REJECT
    DOMAIN, pingma.qq.com, REJECT
  13. @janlay janlay revised this gist Nov 24, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -3,7 +3,7 @@
    2. Use [Text Builder](https://github.com/janlay/text-builder) to build configuration for Surge:
    `$ text-builder -index /path/to/index.txt`
    3. Import configuration via AirDrop/iTunes/Dropbox/iCloud
    4.


    > 本人不提供任何保证和技术支持,使用者自负风险。
    > There are no guarantees, no any support. Use it at your own risk.
  14. @janlay janlay revised this gist Nov 24, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -5,5 +5,5 @@
    3. Import configuration via AirDrop/iTunes/Dropbox/iCloud
    4.

    > 本人不提供任何保证和技术支持,使用者自负风险。
    > 本人不提供任何保证和技术支持,使用者自负风险。
    > There are no guarantees, no any support. Use it at your own risk.
  15. @janlay janlay revised this gist Nov 24, 2015. 1 changed file with 5 additions and 1 deletion.
    6 changes: 5 additions & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -2,4 +2,8 @@
    1. Modify index.txt with your output path and proxy info
    2. Use [Text Builder](https://github.com/janlay/text-builder) to build configuration for Surge:
    `$ text-builder -index /path/to/index.txt`
    3. Import configuration via AirDrop/iTunes/Dropbox/iCloud
    3. Import configuration via AirDrop/iTunes/Dropbox/iCloud
    4.

    > 本人不提供任何保证和技术支持,使用者自负风险。
    > There are no guarantees, no any support. Use it at your own risk.
  16. @janlay janlay revised this gist Nov 24, 2015. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion general.txt
    Original file line number Diff line number Diff line change
    @@ -2,4 +2,5 @@
    interface = 127.0.0.1
    port = 8800
    loglevel = warning
    bypass = 192.168.0.0/16, 10.0.0.0/8, 172.0.0.0/8, 17.0.0.0/8, localhost, *.local, e.crashlytics.com
    skip-proxy = 192.168.0.0/16, 10.0.0.0/8, 172.0.0.0/8, 100.64.0.0/10, localhost, *.local, e.crashlytics.com
    # dns-server = 119.29.29.29, 223.5.5.5, 114.114.114.114
  17. @janlay janlay revised this gist Nov 22, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    ## Install
    1. Modify index.txt with your output path and proxy info
    2. Use Text Builder to build configuration for Surge:
    2. Use [Text Builder](https://github.com/janlay/text-builder) to build configuration for Surge:
    `$ text-builder -index /path/to/index.txt`
    3. Import configuration via AirDrop/iTunes/Dropbox/iCloud
  18. @janlay janlay revised this gist Nov 22, 2015. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,5 @@
    ## Install
    1. Modify index.txt with your output path and proxy info
    2. Use Text Builder to build configuration for Surge:
    `$ text-builder -index /path/to/index.txt`
    `$ text-builder -index /path/to/index.txt`
    3. Import configuration via AirDrop/iTunes/Dropbox/iCloud
  19. @janlay janlay revised this gist Nov 22, 2015. 1 changed file with 4 additions and 17 deletions.
    21 changes: 4 additions & 17 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -1,17 +1,4 @@
    ## Install Configurations
    1. Create your own start.conf:
    - Open Surge for iOS, Tap Download Configuration from URL, input the template config URL:
    https://gist.github.com/janlay/b57476c72a93b7e622a6/raw/start.conf
    2. Download rules.conf
    - Open Surge for iOS, Tap Download Configuration from URL, input the config URL:
    https://gist.github.com/janlay/b57476c72a93b7e622a6/raw/rules.conf
    3. Tap start.conf in the configuration list, then tap Start button.

    ## Update Rules
    1. Update rules.conf
    - Open Surge for iOS, Tap Download Configuration from URL, input the config URL:
    https://gist.github.com/janlay/b57476c72a93b7e622a6/raw/rules.conf
    2. In Surge app, tap Stop if have already started, tap Start to take effect.

    ## Advanced Tips:
    - Working together with Launch Center Pro: surge:///install-config?url=https%3A%2F%2Fgistcdn1.captainz.cc%2Fjanlay%2Fb57476c72a93b7e622a6%2Fraw%2Frules.conf
    ## Install
    1. Modify index.txt with your output path and proxy info
    2. Use Text Builder to build configuration for Surge:
    `$ text-builder -index /path/to/index.txt`
  20. @janlay janlay revised this gist Nov 22, 2015. 2 changed files with 2 additions and 3 deletions.
    3 changes: 2 additions & 1 deletion index.txt
    Original file line number Diff line number Diff line change
    @@ -3,7 +3,8 @@
    #include https://gist.github.com/janlay/b57476c72a93b7e622a6/raw/general.txt

    [Proxy]
    #include proxy.txt
    # Use your own proxy info here
    Proxy = http, 1.2.3.4, 1234

    [Rule]
    #include https://gist.github.com/janlay/b57476c72a93b7e622a6/raw/rules-app-blockers.txt
    2 changes: 0 additions & 2 deletions proxy.txt
    Original file line number Diff line number Diff line change
    @@ -1,2 +0,0 @@
    # Use your own proxy info here
    Proxy = http, 1.2.3.4, 1234
  21. @janlay janlay revised this gist Nov 22, 2015. 1 changed file with 6 additions and 6 deletions.
    12 changes: 6 additions & 6 deletions index.txt
    Original file line number Diff line number Diff line change
    @@ -1,13 +1,13 @@
    #output /Users/janlay/Library/Mobile Documents/com~apple~CloudDocs/Surge.conf
    [General]
    #include general.txt
    #include https://gist.github.com/janlay/b57476c72a93b7e622a6/raw/general.txt

    [Proxy]
    #include proxy.txt

    [Rule]
    #include rules-app-blockers.txt
    #include rules-main.txt
    #include rules-apps.txt
    #include rules-lan.txt
    #include rules-final.txt
    #include https://gist.github.com/janlay/b57476c72a93b7e622a6/raw/rules-app-blockers.txt
    #include https://gist.github.com/janlay/b57476c72a93b7e622a6/raw/rules-main.txt
    #include https://gist.github.com/janlay/b57476c72a93b7e622a6/raw/rules-apps.txt
    #include https://gist.github.com/janlay/b57476c72a93b7e622a6/raw/rules-lan.txt
    #include https://gist.github.com/janlay/b57476c72a93b7e622a6/raw/rules-final.txt
  22. @janlay janlay revised this gist Nov 22, 2015. 7 changed files with 92 additions and 0 deletions.
    5 changes: 5 additions & 0 deletions general.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    # used by Surge for Mac
    interface = 127.0.0.1
    port = 8800
    loglevel = warning
    bypass = 192.168.0.0/16, 10.0.0.0/8, 172.0.0.0/8, 17.0.0.0/8, localhost, *.local, e.crashlytics.com
    2 changes: 2 additions & 0 deletions proxy.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,2 @@
    # Use your own proxy info here
    Proxy = http, 1.2.3.4, 1234
    31 changes: 31 additions & 0 deletions rules-app-blockers.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,31 @@
    # Block privacy tracker within apps
    DOMAIN, ads.mopub.com, REJECT
    DOMAIN, cpro.baidu.com, REJECT
    DOMAIN, monitor.uu.qq.com, REJECT
    DOMAIN, pagead2.googlesyndication.com, REJECT
    DOMAIN, pingma.qq.com, REJECT
    DOMAIN, stat.m.jd.com, REJECT
    DOMAIN-KEYWORD, cnzz, REJECT
    DOMAIN-KEYWORD, flurry.co, REJECT
    DOMAIN-KEYWORD, umeng.co, REJECT
    DOMAIN-SUFFIX, 127.net, REJECT
    DOMAIN-SUFFIX, applovin.com, REJECT
    DOMAIN-SUFFIX, beacon.qq.com, REJECT
    DOMAIN-SUFFIX, doubleclick.net, REJECT
    DOMAIN-SUFFIX, mmstat.com, REJECT
    DOMAIN-SUFFIX, mob.com, REJECT
    DOMAIN-SUFFIX, sponsorpay.com, REJECT
    DOMAIN-SUFFIX, youmi.net, REJECT

    # Prevent stream services from displaying ads
    DOMAIN, ad.api.3g.youku.com, REJECT
    DOMAIN, agn.aty.sohu.com, REJECT
    DOMAIN, ark.letv.com, REJECT
    DOMAIN, asimgs.pplive.cn, REJECT
    DOMAIN, atm.youku.com, REJECT
    DOMAIN, lives.l.qq.com, REJECT

    # Disable customized fonts
    DOMAIN, fonts.googleapis.com, REJECT
    # Prevent sniffer from a public WiFi
    DOMAIN, init.icloud-analysis.com, REJECT
    10 changes: 10 additions & 0 deletions rules-apps.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,10 @@
    # Workaround for some apps
    # Instagram
    DOMAIN-KEYWORD, instagram, Proxy, force-remote-dns
    # SeekingAlpha
    DOMAIN-SUFFIX, seekingalpha.com, DIRECT
    # Telegram
    IP-CIDR, 109.239.140.0/24, Proxy, no-resolve
    IP-CIDR, 149.154.160.0/20, Proxy, no-resolve
    IP-CIDR, 91.108.4.0/22, Proxy, no-resolve
    IP-CIDR, 91.108.56.0/22, Proxy, no-resolve
    4 changes: 4 additions & 0 deletions rules-final.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,4 @@
    # Detect local network
    GEOIP, CN, DIRECT
    # Use proxy for all others
    FINAL, Proxy
    6 changes: 6 additions & 0 deletions rules-lan.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,6 @@
    # Reserved networks, debugging rules should place above this line
    IP-CIDR, 10.0.0.0/8, DIRECT
    IP-CIDR, 100.64.0.0/10, DIRECT
    IP-CIDR, 127.0.0.0/8, DIRECT
    IP-CIDR, 172.0.0.0/8, DIRECT
    IP-CIDR, 192.168.0.0/16, DIRECT
    34 changes: 34 additions & 0 deletions rules-main.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,34 @@
    DOMAIN-SUFFIX, cn, DIRECT
    DOMAIN-KEYWORD, ali, DIRECT
    DOMAIN-KEYWORD, taobao, DIRECT
    DOMAIN-KEYWORD, 360, DIRECT
    DOMAIN-KEYWORD, baidu, DIRECT
    DOMAIN-SUFFIX, 126.net, DIRECT
    DOMAIN-SUFFIX, 163.com, DIRECT
    DOMAIN-SUFFIX, gtimg.com, DIRECT
    DOMAIN-SUFFIX, jd.com, DIRECT
    DOMAIN-SUFFIX, netease.com, DIRECT
    DOMAIN-SUFFIX, qq.com, DIRECT

    # Some services are available locally
    DOMAIN-SUFFIX, ls.apple.com, DIRECT
    DOMAIN-SUFFIX, itunes.apple.com, DIRECT
    DOMAIN-SUFFIX, dl.google.com, DIRECT

    # Apple services
    DOMAIN-SUFFIX, apple.com, Proxy
    DOMAIN-SUFFIX, icloud.com, Proxy
    DOMAIN-SUFFIX, mzstatic.com, Proxy
    DOMAIN-KEYWORD, aka, Proxy

    # Streaming services, comment out if you don't need
    DOMAIN-KEYWORD, qiyi, DIRECT
    DOMAIN-KEYWORD, sohu, DIRECT

    # Force some domains which are fucked by GFW while resolving DNS
    DOMAIN-KEYWORD, facebook, Proxy, force-remote-dns
    DOMAIN-KEYWORD, gmail, Proxy, force-remote-dns
    DOMAIN-KEYWORD, google, Proxy, force-remote-dns
    DOMAIN-KEYWORD, twitter, Proxy, force-remote-dns
    DOMAIN-KEYWORD, youtube, Proxy, force-remote-dns
    DOMAIN-SUFFIX, twimg.com, Proxy, force-remote-dns
  23. @janlay janlay revised this gist Nov 22, 2015. 3 changed files with 13 additions and 117 deletions.
    13 changes: 13 additions & 0 deletions index.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,13 @@
    #output /Users/janlay/Library/Mobile Documents/com~apple~CloudDocs/Surge.conf
    [General]
    #include general.txt

    [Proxy]
    #include proxy.txt

    [Rule]
    #include rules-app-blockers.txt
    #include rules-main.txt
    #include rules-apps.txt
    #include rules-lan.txt
    #include rules-final.txt
    113 changes: 0 additions & 113 deletions rules.conf
    Original file line number Diff line number Diff line change
    @@ -1,113 +0,0 @@
    # This config file was created for myself (@janlay). You may want to add or remove some rules to make efficient use of the Internet.

    # This file depends on the start.conf which defines your own proxy.
    # Check start.conf for more details and understand how the directive `PROXY-OVERRIDE` works.

    [General]
    loglevel = notify
    skip-proxy = 192.168.0.0/16, 10.0.0.0/8, 172.0.0.0/8, localhost, *.local, e.crashlytics.com
    bypass-tun = 192.168.0.0/16, 10.0.0.0/8, 172.0.0.0/8
    # dns-server = 119.29.29.29, 223.5.5.5, 114.114.114.114

    # leave this line
    [Proxy]
    Proxy = https, 1.2.3.4, 1234

    [Rule]
    # Accelerate most visited sites, part 1
    DOMAIN-SUFFIX, cn, DIRECT
    DOMAIN-KEYWORD, ali, DIRECT
    DOMAIN-KEYWORD, taobao, DIRECT

    # Block privacy tracker within apps
    DOMAIN, ads.mopub.com, REJECT
    DOMAIN, cpro.baidu.com, REJECT
    DOMAIN, monitor.uu.qq.com, REJECT
    DOMAIN, pagead2.googlesyndication.com, REJECT
    DOMAIN, pingma.qq.com, REJECT
    DOMAIN, stat.m.jd.com, REJECT
    DOMAIN-KEYWORD, cnzz, REJECT
    DOMAIN-KEYWORD, flurry.co, REJECT
    DOMAIN-KEYWORD, umeng.co, REJECT
    DOMAIN-SUFFIX, 127.net, REJECT
    DOMAIN-SUFFIX, applovin.com, REJECT
    DOMAIN-SUFFIX, beacon.qq.com, REJECT
    DOMAIN-SUFFIX, doubleclick.net, REJECT
    DOMAIN-SUFFIX, mmstat.com, REJECT
    DOMAIN-SUFFIX, mob.com, REJECT
    DOMAIN-SUFFIX, sponsorpay.com, REJECT
    DOMAIN-SUFFIX, youmi.net, REJECT

    # Prevent stream services from displaying ads
    DOMAIN, ad.api.3g.youku.com, REJECT
    DOMAIN, agn.aty.sohu.com, REJECT
    DOMAIN, ark.letv.com, REJECT
    DOMAIN, asimgs.pplive.cn, REJECT
    DOMAIN, atm.youku.com, REJECT
    DOMAIN, lives.l.qq.com, REJECT

    # Disable customized fonts
    DOMAIN, fonts.googleapis.com, REJECT
    # Prevent sniffer from a public WiFi
    DOMAIN, init.icloud-analysis.com, REJECT

    # Accelerate most visited sites, part 2
    DOMAIN-KEYWORD, 360, DIRECT
    DOMAIN-KEYWORD, baidu, DIRECT
    DOMAIN-SUFFIX, 126.net, DIRECT
    DOMAIN-SUFFIX, 163.com, DIRECT
    DOMAIN-SUFFIX, gtimg.com, DIRECT
    DOMAIN-SUFFIX, jd.com, DIRECT
    DOMAIN-SUFFIX, netease.com, DIRECT
    DOMAIN-SUFFIX, qq.com, DIRECT

    # Some services are available locally
    DOMAIN-SUFFIX, ls.apple.com, DIRECT
    DOMAIN-SUFFIX, itunes.apple.com, DIRECT
    DOMAIN-SUFFIX, dl.google.com, DIRECT

    # Apple services
    DOMAIN-SUFFIX, apple.com, Proxy
    DOMAIN-SUFFIX, icloud.com, Proxy
    DOMAIN-SUFFIX, mzstatic.com, Proxy
    DOMAIN-KEYWORD, aka, Proxy

    # Streaming services, comment out if you don't need
    DOMAIN-KEYWORD, qiyi, DIRECT
    DOMAIN-KEYWORD, sohu, DIRECT

    # Force some domains which are fucked by GFW while resolving DNS
    DOMAIN-KEYWORD, facebook, Proxy, force-remote-dns
    DOMAIN-KEYWORD, gmail, Proxy, force-remote-dns
    DOMAIN-KEYWORD, google, Proxy, force-remote-dns
    DOMAIN-KEYWORD, twitter, Proxy, force-remote-dns
    DOMAIN-KEYWORD, youtube, Proxy, force-remote-dns
    DOMAIN-SUFFIX, twimg.com, Proxy, force-remote-dns

    # Workaround for some apps
    # Instagram
    DOMAIN-KEYWORD, instagram, Proxy, force-remote-dns
    # SeekingAlpha
    DOMAIN-SUFFIX, seekingalpha.com, DIRECT
    # Ads in iQiyi
    # IP-CIDR, 122.228.0.0/16, REJECT, no-resolve
    # IP-CIDR, 61.128.0.0/10, REJECT, no-resolve
    # IP-CIDR, 115.224.0.0/12, REJECT, no-resolve
    # IP-CIDR, 183.128.0.0/10, REJECT, no-resolve
    # Telegram
    IP-CIDR, 109.239.140.0/24, Proxy, no-resolve
    IP-CIDR, 149.154.160.0/20, Proxy, no-resolve
    IP-CIDR, 91.108.4.0/22, Proxy, no-resolve
    IP-CIDR, 91.108.56.0/22, Proxy, no-resolve

    # Reserved networks, debugging rules should place above this line
    IP-CIDR, 10.0.0.0/8, DIRECT
    IP-CIDR, 100.64.0.0/10, DIRECT
    IP-CIDR, 127.0.0.0/8, DIRECT
    IP-CIDR, 172.0.0.0/8, DIRECT
    IP-CIDR, 192.168.0.0/16, DIRECT

    # Detect local network
    GEOIP, CN, DIRECT
    # Use proxy for all others
    FINAL, Proxy
    4 changes: 0 additions & 4 deletions start.conf
    Original file line number Diff line number Diff line change
    @@ -1,4 +0,0 @@
    #!PROXY-OVERRIDE:rules.conf
    [Proxy]
    # Use your own proxy config here
    Proxy = https, server, port, username, password
  24. @janlay janlay revised this gist Nov 16, 2015. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -1,17 +1,17 @@
    ## Install Configurations
    1. Create your own start.conf:
    - Tap [here](surge:///install-config?url=https%3A%2F%2Fgistcdn1.captainz.cc%2Fjanlay%2Fb57476c72a93b7e622a6%2Fraw%2Fstart.conf) to install start.conf from template (build 386+)
    - Open Surge for iOS, Tap Download Configuration from URL, input the template config URL:
    https://gist.github.com/janlay/b57476c72a93b7e622a6/raw/start.conf
    2. Download rules.conf
    - Tap [here](surge:///install-config?url=https%3A%2F%2Fgistcdn1.captainz.cc%2Fjanlay%2Fb57476c72a93b7e622a6%2Fraw%2Frules.conf) to install (build 386+)
    - Open Surge for iOS, Tap Download Configuration from URL, input the config URL:
    https://gist.github.com/janlay/b57476c72a93b7e622a6/raw/rules.conf
    3. Tap start.conf in the configuration list, then tap Start button.

    ## Update Rules
    1. Update rules.conf
    - Tap [here](surge:///install-config?url=https%3A%2F%2Fgistcdn1.captainz.cc%2Fjanlay%2Fb57476c72a93b7e622a6%2Fraw%2Frules.conf) to install (build 386+)
    - Open Surge for iOS, Tap Download Configuration from URL, input the config URL:
    https://gist.github.com/janlay/b57476c72a93b7e622a6/raw/rules.conf
    2. In Surge app, tap Stop if have already started, tap Start to take effect.

    ## Advanced Tips:
    - Working together with Launch Center Pro: surge:///install-config?url=https%3A%2F%2Fgistcdn1.captainz.cc%2Fjanlay%2Fb57476c72a93b7e622a6%2Fraw%2Frules.conf
  25. @janlay janlay revised this gist Nov 16, 2015. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -1,17 +1,17 @@
    ## Install Configurations
    1. Create your own start.conf:
    - Tap [here](https://gist.githubusercontent.com/janlay/b57476c72a93b7e622a6/raw/start.conf) to install start.conf from template (build 386+)
    - Tap [here](surge:///install-config?url=https%3A%2F%2Fgist.githubusercontent.com%2Fjanlay%2Fb57476c72a93b7e622a6%2Fraw%2Fstart.conf) to install start.conf from template (build 386+)
    - Open Surge for iOS, Tap Download Configuration from URL, input the template config URL:
    https://gist.github.com/janlay/b57476c72a93b7e622a6/raw/start.conf
    2. Download rules.conf
    - Tap [here](https://gist.githubusercontent.com/janlay/b57476c72a93b7e622a6/raw/rules.conf) to install (build 386+)
    - Tap [here](surge:///install-config?url=https%3A%2F%2Fgist.githubusercontent.com%2Fjanlay%2Fb57476c72a93b7e622a6%2Fraw%2Frules.conf) to install (build 386+)
    - Open Surge for iOS, Tap Download Configuration from URL, input the config URL:
    https://gist.github.com/janlay/b57476c72a93b7e622a6/raw/rules.conf
    3. Tap start.conf in the configuration list, then tap Start button.

    ## Update Rules
    1. Update rules.conf
    - Tap [here](https://gist.githubusercontent.com/janlay/b57476c72a93b7e622a6/raw/rules.conf) to install (build 386+)
    - Tap [here](surge:///install-config?url=https%3A%2F%2Fgist.githubusercontent.com%2Fjanlay%2Fb57476c72a93b7e622a6%2Fraw%2Frules.conf) to install (build 386+)
    - Open Surge for iOS, Tap Download Configuration from URL, input the config URL:
    https://gist.github.com/janlay/b57476c72a93b7e622a6/raw/rules.conf
    2. In Surge app, tap Stop if have already started, tap Start to take effect.
  26. @janlay janlay revised this gist Nov 16, 2015. 1 changed file with 17 additions and 0 deletions.
    17 changes: 17 additions & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,17 @@
    ## Install Configurations
    1. Create your own start.conf:
    - Tap [here](https://gist.github.com/janlay/b57476c72a93b7e622a6/raw/start.conf) to install start.conf from template (build 386+)
    - Open Surge for iOS, Tap Download Configuration from URL, input the template config URL:
    https://gist.github.com/janlay/b57476c72a93b7e622a6/raw/start.conf
    2. Download rules.conf
    - Tap [here](https://gist.github.com/janlay/b57476c72a93b7e622a6/raw/rules.conf) to install (build 386+)
    - Open Surge for iOS, Tap Download Configuration from URL, input the config URL:
    https://gist.github.com/janlay/b57476c72a93b7e622a6/raw/rules.conf
    3. Tap start.conf in the configuration list, then tap Start button.

    ## Update Rules
    1. Update rules.conf
    - Tap [here](https://gist.github.com/janlay/b57476c72a93b7e622a6/raw/rules.conf) to install (build 386+)
    - Open Surge for iOS, Tap Download Configuration from URL, input the config URL:
    https://gist.github.com/janlay/b57476c72a93b7e622a6/raw/rules.conf
    2. In Surge app, tap Stop if have already started, tap Start to take effect.
  27. @janlay janlay revised this gist Nov 16, 2015. No changes.
  28. @janlay janlay revised this gist Nov 13, 2015. 1 changed file with 6 additions and 4 deletions.
    10 changes: 6 additions & 4 deletions rules.conf
    Original file line number Diff line number Diff line change
    @@ -87,11 +87,13 @@ DOMAIN-SUFFIX, twimg.com, Proxy, force-remote-dns
    # Workaround for some apps
    # Instagram
    DOMAIN-KEYWORD, instagram, Proxy, force-remote-dns
    # SeekingAlpha
    DOMAIN-SUFFIX, seekingalpha.com, DIRECT
    # Ads in iQiyi
    IP-CIDR, 122.228.0.0/16, REJECT, no-resolve
    IP-CIDR, 61.128.0.0/10, REJECT, no-resolve
    IP-CIDR, 115.224.0.0/12, REJECT, no-resolve
    IP-CIDR, 183.128.0.0/10, REJECT, no-resolve
    # IP-CIDR, 122.228.0.0/16, REJECT, no-resolve
    # IP-CIDR, 61.128.0.0/10, REJECT, no-resolve
    # IP-CIDR, 115.224.0.0/12, REJECT, no-resolve
    # IP-CIDR, 183.128.0.0/10, REJECT, no-resolve
    # Telegram
    IP-CIDR, 109.239.140.0/24, Proxy, no-resolve
    IP-CIDR, 149.154.160.0/20, Proxy, no-resolve
  29. @janlay janlay revised this gist Nov 11, 2015. 1 changed file with 1 addition and 2 deletions.
    3 changes: 1 addition & 2 deletions rules.conf
    Original file line number Diff line number Diff line change
    @@ -15,6 +15,7 @@ Proxy = https, 1.2.3.4, 1234

    [Rule]
    # Accelerate most visited sites, part 1
    DOMAIN-SUFFIX, cn, DIRECT
    DOMAIN-KEYWORD, ali, DIRECT
    DOMAIN-KEYWORD, taobao, DIRECT

    @@ -34,7 +35,6 @@ DOMAIN-SUFFIX, beacon.qq.com, REJECT
    DOMAIN-SUFFIX, doubleclick.net, REJECT
    DOMAIN-SUFFIX, mmstat.com, REJECT
    DOMAIN-SUFFIX, mob.com, REJECT
    DOMAIN-SUFFIX, sinajs.cn, REJECT
    DOMAIN-SUFFIX, sponsorpay.com, REJECT
    DOMAIN-SUFFIX, youmi.net, REJECT

    @@ -52,7 +52,6 @@ DOMAIN, fonts.googleapis.com, REJECT
    DOMAIN, init.icloud-analysis.com, REJECT

    # Accelerate most visited sites, part 2
    DOMAIN-SUFFIX, cn, DIRECT
    DOMAIN-KEYWORD, 360, DIRECT
    DOMAIN-KEYWORD, baidu, DIRECT
    DOMAIN-SUFFIX, 126.net, DIRECT
  30. @janlay janlay revised this gist Nov 9, 2015. 2 changed files with 8 additions and 5 deletions.
    13 changes: 8 additions & 5 deletions rules.conf
    Original file line number Diff line number Diff line change
    @@ -1,15 +1,15 @@
    # This config file was created for myself (@janlay). You may want to add or remove some rules to make efficient use of the Internet.

    # This file depends on the main.conf which defines your own proxy.
    # Check main.conf for more details and understand how the directive `PROXY-OVERRIDE` works.
    # This file depends on the start.conf which defines your own proxy.
    # Check start.conf for more details and understand how the directive `PROXY-OVERRIDE` works.

    [General]
    loglevel = notify
    skip-proxy = 192.168.0.0/16, 10.0.0.0/8, 172.0.0.0/8, localhost, *.local, e.crashlytics.com
    bypass-tun = 192.168.0.0/16, 10.0.0.0/8, 172.0.0.0/8
    # dns-server = 119.29.29.29, 223.5.5.5, 114.114.114.114

    # Leave these two lines
    # leave this line
    [Proxy]
    Proxy = https, 1.2.3.4, 1234

    @@ -88,8 +88,11 @@ DOMAIN-SUFFIX, twimg.com, Proxy, force-remote-dns
    # Workaround for some apps
    # Instagram
    DOMAIN-KEYWORD, instagram, Proxy, force-remote-dns
    # Ads in iqiyi
    IP-CIDR, 221.179.140.0/24, REJECT, no-resolve
    # Ads in iQiyi
    IP-CIDR, 122.228.0.0/16, REJECT, no-resolve
    IP-CIDR, 61.128.0.0/10, REJECT, no-resolve
    IP-CIDR, 115.224.0.0/12, REJECT, no-resolve
    IP-CIDR, 183.128.0.0/10, REJECT, no-resolve
    # Telegram
    IP-CIDR, 109.239.140.0/24, Proxy, no-resolve
    IP-CIDR, 149.154.160.0/20, Proxy, no-resolve
    File renamed without changes.