-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Parse Server livequery on AWS (Websocket error 403) #3635
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Did you configure Parse-server correctly to start the liveQuery server? |
This is my current server code... var express = require('express'); // Subscription for Livequery // Mailgun Configuration var port = 1337; //Parse Dashboard var allowInsecureHTTP = true; // Serve the Mailgun on /email URL prefix
}); // Serve the Parse Dashboard on the /parsedashboard URL prefix var portdash = 4040; |
Are you running on Elastic beanstalk or a naked instance? Are you using ELB? Do you have any server logs when running with VERBOSE=1 ? |
i used the AWS Parse Server by Bitnami AMI to create a new instance. Could this be the issue? and no im not using ELB. No server logs either... |
I have no idea what that particular image does, it may as it may not. |
Okay, lets say start from the beginning, i launched the instance and the serve.js was like this:
What would be the code to enable livequery? (just want to make sure im right) |
From the docs, you'd need: // Initialize a LiveQuery server instance, app is the express app of your Parse Server
let httpServer = require('http').createServer(app);
httpServer.listen(port);
var parseLiveQueryServer = ParseServer.createLiveQueryServer(httpServer); I see also something, you're using twice app with calling listen on 2 different ports. That won't work. you should have: var serverApp = express();
var api = new ParseServer({...});
serverApp.use('/parse', api);
var port = 1337;
/*
// !!! Important, this should be removed
// That will prevent proper init from the LQ server
app.listen(port, function() {
console.log('parse-server running on port ' + port);
});
*/
var httpServer = require('http').createServer(serverApp);
httpServer.listen(port);
var parseLiveQueryServer = ParseServer.createLiveQueryServer(httpServer);
var dashboardApp = express();
var ParseDashboard = require('parse-dashboard');
var dashboard = new ParseDashboard({...});
var allowInsecureHTTP = true;
// Serve the Parse Dashboard on the /parsedashboard URL prefix
dashboardApp.use('/', dashboard);
var portdash = 4040;
dashboardApp.listen(portdash, function() {
console.log('parse-dashboard running on port ' + portdash);
}); |
i have tried your answer but it doesnt work either. If i were to start afresh and not use Bitnami's AMI, will it work? and do you have a guide somewhere to teach me the steps? im kinda new to parse... |
The docs link I provided should give the most information about it. I'm not sure what responds with 403 on your liveQuery client, perhaps missing keys in the JS-SDK. |
One thing to take note is that if i host it on heroku, it works 100%. Only only AWS the livequery is not working. I am so confused. I have searched many sites regarding issue and have not come to a solution |
So if it works on heroku, that's not an issue with parse-server itself, or your configuration, but with the way you're deployed on AWS. I recommend you stick with heroku for now, and keep exploring why AWS is reluctant with you., We have many reports of people having successfully deployed to AWS, however we don't provide provider specific help. |
I was wondering if anyone has a solution to this issue with AWS. flovilmart made mention that people have successfully set up live query on AWS, but unfortunately it looks like no-one has shared the details. If anyone has successfully set this up on AWS would you be so kind as to share the secret? LOL, but really any help with this issue would be greatly appreciated. I am getting the same 403 error and have followed the steps in every article I could find on the issue with no luck. |
@LilMoke Check out this guide https://github.com/SoBump/ParseLiveQueryHelp/blob/master/guide.md |
Awesome thanks so much. I took a quick look and I think it told me my problem. I was using a classic old balancer and my nginx file was slightly wrong. Thanks again, I will try it shortly. |
Issue Description
I am using currently on a project trying to make a chat system using parse server livequery. I am using AWS's Parse Server by Bitnami AMI to create a new instance. And i did the setups exactly as i did on my localhost. However whenever i run my ionic 2 application, it will show the websocket error as shown below.
WebSocket connection to 'ws://ec2-xxxx.ap-southeast-1.compute.amazonaws.com/parse' failed: Error during WebSocket handshake: Unexpected response code: 403
Steps to reproduce
Expected Results
There shouldnt be a websocket error and the livequery will auto reload and show on my chat system.
Actual Outcome
It shows the error and whenever i send a text to a user, the other party does not receive and updates until he backs out one screen and went back the same page.
Environment Setup
Server
Database
The text was updated successfully, but these errors were encountered: