I’m planning to add live chat to my app. I will use live query. But in front of my parse servers, I have nginx as reverse proxy. I want to direct live query to specific server. But rest guide on docs doesnt have any endpoint for live queries.
Whats the endpoint for live queries? Or how can I send live query requests to same server on nginx?
So live query doesnt have an endpoint. But It simply listen different port? Is that correct? Can anyone confirm?
Edit: And how android api use this. We dont enter any url to livequery and live query use default parse server endpoint. How can we determine if app send live query or normal request?
LiveQuery uses websockets so you need to upgrade your connection to ws:// or wss://, If you are running your Live Query server on the same port as your parse server, you can use that. It’s recommend to separate your live query server though:
Thanks. I know It uses ws protocol but I have a question. We initialize parse server like this:
Parse.initialize(new Parse.Configuration.Builder(this)
.applicationId("YOUR_APP_ID")
// if defined
.clientKey("YOUR_CLIENT_KEY")
.server("http://server:1337/parse/")
.build()
);
Well, I don’t use Android, so I won’t pretend to be an expert there, but from what I know from the other SDKs (iOS, Swift, and JS) they all seem to work the same in reference to your question above. So yes, since you are not supplying a specific LiveQuery URL, it will use your parse server one and upgrade it to a web socket for LiveQueries, ws://server:1337/parse/. And this will work if you enable the live query server on your parse server.
The docs I linked earlier mention that running a LiveQuery server on your Parse Server can cause a bottleneck depending on your application and provides some suggestions for scalability. If you end up using the docs suggestions, you will probably end up specifying a different LiveQuery server URL than your Parse Server URL.