- Have Safari running on a tethered iOS device.
- Launch the proxy with -c :9222 (not sure if -c matters).
- Quickly (as in -- scripted) make requests to http://localhost:9222/json.
A few first requests will return "[]", then it will begin returning a correct list of tabs.
I suspect it's a race between the HTTP requests and the proxy's handshake with the device.
Could the proxy hold HTTP responses until the handshake is done? The requests would just take a few seconds when made right after launching the proxy.