HTTP API / api / gling 当启动时无动于衷
作者: zbeosf创建于 2026年8月26日更新于 2026年8月26日
- Preferences → enable HTTP API, enable Hide at launch.
- Quit and relaunch SwitchHosts (do not open the main window).
curl 'http://127.0.0.1:50761/api/list'— works, lists profiles.curl 'http://127.0.0.1:50761/api/toggle?id=<some-id>'— returnsok.curl 'http://127.0.0.1:50761/api/list'— theonflag is unchanged, and/etc/hostsis untouched.- 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