Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
surge wifi changed ,auto change proxy
* @description
* 如果是家里WI-FI则开启直连模式
* 如果不是家里WI-FI则开启代理模式
const WIFI_DONT_NEED_PROXYS = ['xiaomi_Alan_5G'];
if (WIFI_DONT_NEED_PROXYS.includes($network.wifi.ssid)) {
$'Surge', 'Wi-Fi changed', 'use direct mode');
} else {
$surge.setSelectGroupPolicy('Final-select', 'Group');
$'Surge', 'Wi-Fi changed', 'use rule-based proxy mode');

This comment has been minimized.

Copy link
Owner Author

@alanhg alanhg commented Feb 6, 2021


script1 = type=event,event-name=network-changed,script-path=wifi-changed.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment