Skip to content

Instantly share code, notes, and snippets.

@creamidea
Last active February 17, 2019 03:12
Show Gist options
  • Save creamidea/14cc34e0bcfbf5ade0c36afed1e50b16 to your computer and use it in GitHub Desktop.
Save creamidea/14cc34e0bcfbf5ade0c36afed1e50b16 to your computer and use it in GitHub Desktop.
简单的将switchproxy中的规则变成surge的规则,只支持 DOMAIN-HOST
// Step 1: open the switchproxy's option page
// Step 2: click the "auto switch" on the left bar
// Step 3: click the edit button
// Step 4: open the developer tools
// Step 5: input the code below
var source = $('textarea[ng-model="source.code"]')[0].value
var surgeRules = source.replace(/\*\.(.*?)\s+\+proxy/g,"DOMAIN-SUFFIX,$1,Proxy")
copy(surgeRules)
// Step 6: replace the original rules with surgeRules(Ctrl+V)
// Step 7: upload to the iCloud (Surge)
// Surge manual: https://surge.run/manual/
// Switch: https://github.com/FelisCatus/SwitchyOmega/wiki/SwitchyOmega-conditions-format#result-profile
// Public DNS of China: http://publicdns.cn/
// iCloud: https://www.icloud.com/#iclouddrive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment