HTTP API / api / gling 当启动时无动于衷

作者: zbeosf创建于 2026年8月26日更新于 2026年8月26日
  1. Preferences → enable HTTP API, enable Hide at launch.
  2. Quit and relaunch SwitchHosts (do not open the main window).
  3. curl 'http://127.0.0.1:50761/api/list' — works, lists profiles.
  4. curl 'http://127.0.0.1:50761/api/toggle?id=<some-id>' — returns ok.
  5. curl 'http://127.0.0.1:50761/api/list' — the on flag is unchanged, and /etc/hosts is untouched.
  6. Open the main window once from the tray, then repeat step 4 — now it works. The app log shows the request arriving (toggle: <id>) in both cases, so the request is received and only the broadcast is lost.

内容来源: oldj/SwitchHosts