Android default WebSocket live sources
The standalone Android host supports HTTP(S) and WS/WSS by default. Ordinary live sources do not require a custom Transport. QuickJS is embedded in the map core and scripts use the same shape as browser/desktop scripts. Applications own UI and system network configuration.
import {map} from 'sqsmap';
export const sessionMode='persistent';
map.addSource('live',{type:'geojson',
data:{type:'FeatureCollection',features:[]},
sqsLive:{fields:{n:'number'},allowDelta:true}});
map.addLayer({id:'live-points',type:'circle',source:'live',
paint:{'circle-radius':12,'circle-color':'red'}});
await map.sqs.flush();
const source=await map.getSource('live');
const receiver=await source.sqs.connectLive({transport:{
type:'websocket',url:'wss://your-server.example/live',reconnectDelayMs:2000}});
map.on('sourcedata',event=>{if(event.sourceId==='live')console.log(event.sqsLive);});
export default {receiver};
Servers send gis-live-v1 text snapshot/delta messages with source fields,epoch and decimal128-bit sequence rules. The core owns reconnectDelayMs,pause/resume/stop and scene ownership; see live receivers. This is a live-source receiver rather than a generic bidirectional/binary socket API.
Two streams run independently of four HTTP workers. Receive-buffer reservations share64MiB; messages obey native maxBytes,up to16MiB. Awaited Owner delivery provides backpressure; copied responses have a separate shared budget. Handshakes permit8seconds/16KiB headers. Text fragmentation,ping/pong/close,masked client control frames and strict UTF8/length validation are supported.
WSS uses platform trust and HTTPS endpoint identification, rejecting untrusted certificates and wrong hostnames. Cancellation closes registered TCP/TLS sockets and releases budgets. DNS uses the platform resolver and may finish on its resolver timeout. Android cleartext/security and trust configuration remain application responsibilities.
Extensions/compression,binary messages,custom headers/subprotocols,proxy settings and automatic cookie/credential propagation are unavailable. Supply your own Transport when needed. API24/ARM64JNI compilation and36 actual local WS/WSS/LinuxJVM/script/softwareGPU checks passed; phone system/GPU acceptance remains pending.
Protocol behavior follows RFC6455; TLS endpoint identification uses Android SSLParameters. The implementation is independent and adds no production dependency.