hi,
i am integrating traccar in my mobile app, the app is built with ionic react + capacitorjs.
rest requests work fine as i am able to create a session both in the browser and the ios simulator.
websocket connections work fine when in the browser, but after compiling and running in the ios simulator the traccar server yields a 503 Service Unavailable when connecting the websocket. the difference i see is when running in the simulator/device is the origin header changes from http://localhost
in the browser (which works) to capacitor://localhost
in the simulator/device (which does not).
if that's the issue, is there a way to support this origin too? thanks a lot
It should work fine as long as you include the session header.
i am using the javascript websocket apis to create the websocket, i cannot include any headers.. https://developer.mozilla.org/en-US/docs/Web/API/WebSocket
i just tried appending ?token=mytoken to the url when creating the websocket and now it looks like it's working.. interesting how that wasn't necessary on the browser but it is on simulator/devices
hi,
i am integrating traccar in my mobile app, the app is built with ionic react + capacitorjs.
rest requests work fine as i am able to create a session both in the browser and the ios simulator.
websocket connections work fine when in the browser, but after compiling and running in the ios simulator the traccar server yields a 503 Service Unavailable when connecting the websocket. the difference i see is when running in the simulator/device is the origin header changes from
http://localhost
in the browser (which works) tocapacitor://localhost
in the simulator/device (which does not).if that's the issue, is there a way to support this origin too? thanks a lot