I got everything working over https, I’m guessing the problem was a session token mismatch going from one to the other.
However I still get WebSocket connection failed using wss://mydomain.com/parse (or any variation of the domain)
In the parse logs it says:
parse-server running on https://mydomain/parse
info: Parse LiveQuery Server starts running
Here’s my config:
{
“appId”: “myappID”,
“masterKey”: “xxx”,
“appName”: “parse-server”,
“mountPath”: “/parse”,
“port”: “1337”,
“host”: “127.0.0.1”,
“serverURL”: “https://mydomain/parse”,
“databaseURI”: “mongodb://bn_parse:[email protected]:27017/bitnami_parse”,
“cloud”: “/opt/bitnami/cloud/main.js”,
“liveQuery”: {
“classNames”: ["_User","_Role",“TestObject”]
},
“startLiveQueryServer”: “true”,
“liveQueryServerOptions”: {
“appId”: “myappID”,
“serverURL”: “wss://mydomain/parse”,
“masterKey”: “xxx”,
“logLevel”: “VERBOSE”
}
}
Here’s the client side code I’m using with the JS SDK:
Parse.initialize(‘myappID’);
Parse.serverURL = ‘https://mydomain/parse’;
let TestObject = new Parse.Object.extend(‘TestObject’);
let q = new Parse.Query(‘TestObject’);
q.equalTo(‘foo’, ‘bar’);
const results = q.find();
results.then(function(obj) {
console.log(obj);
});
let subscription = q.subscribe();
console.log(subscription);
The query works as expected and gives the results in the console. Then it’s just a bunch of websocket connection failed.
Again, I’m not using the aws loadbalancer and certificate manager ssl, I’m pointing the domain directly at the server IP and using a let’s encrypt ssl cert directly on the server created by the bitnami let’s encrypt tool that came pre-packaged in the ami. HTTPS is working as expected.
Once thing I have noticed though that is no matter what I change the serverUrl value to under liveQueryServerOptions the console error always shows WebSocket connection wss://mydomain/parse failed, even if I remove /parse, change it to the IP address or whatever and then restart parse.
I feel like I’m missing something really obvious and dumb here.