-
-
Save kid-oh/085c01e0c82d0fb4d2758f607f1c426b to your computer and use it in GitHub Desktop.
surge wifi changed ,auto change proxy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @description | |
* 如果是家里WI-FI则开启直连模式 | |
* 如果不是家里WI-FI则开启代理模式 | |
*/ | |
const WIFI_DONT_NEED_PROXYS = ['Xiaomi_RQH']; | |
if (WIFI_DONT_NEED_PROXYS.includes($network.wifi.ssid)) { | |
$surge.setOutboundMode('direct'); | |
} else { | |
$surge.setSelectGroupPolicy('Final-select', 'Group'); | |
$surge.setOutboundMode('rule'); | |
} | |
$done(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment