-
Notifications
You must be signed in to change notification settings - Fork 47
Description
Crosspost from Discord
A bit of digging suggests that on newer Android phones, the 01 mobile app will refuse to connect to a local livekit server (such as the one exposed by the 01 python code) that is served over http rather than https. I had suspected this to be the cause of my app not connecting, and a logcat over adb confirms it - the app produces this in the log trace (after the token check passes)
09-20 23:38:40.653 5218 5273 W ReactNativeJS: 'websocket closed', { room: undefined,
09-20 23:38:40.653 5218 5273 W ReactNativeJS: roomID: undefined,
09-20 23:38:40.653 5218 5273 W ReactNativeJS: participant: undefined,
09-20 23:38:40.653 5218 5273 W ReactNativeJS: pID: undefined,
09-20 23:38:40.653 5218 5273 W ReactNativeJS: reason: 'CLEARTEXT communication to 192.168.1.159 not permitted by network security policy',
09-20 23:38:40.653 5218 5273 W ReactNativeJS: code: 1006,
09-20 23:38:40.653 5218 5273 W ReactNativeJS: wasClean: undefined,
09-20 23:38:40.653 5218 5273 W ReactNativeJS: state: 4 }
Of course, using ngrok you get an https endpoint, so folks doing the --expose
flag when starting the 01 server should not experience this.
I only say 'newer Android phones' because I searched the error line in Perplexity
: https://www.perplexity.ai/search/reactnaivejs-livekit-error-cle-WPS1IVDRQ56eacKjW0o8lg
That (re)search thread proposes fixes, if desired - enabling cleartext communication only for local networks and with a clear warning to users could be a reasonable idea. Or denying it and alerting on 'http' rather than 'https'. Or catching and relaying the warning etc. etc.
Alternatively, updating the documentation to say this won't work is fine, too. I have no particular opinion either way. 😊