Skip to content

SSL and LiveQuery? #271

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

Closed
cheesykyle opened this issue Apr 30, 2016 · 3 comments
Closed

SSL and LiveQuery? #271

cheesykyle opened this issue Apr 30, 2016 · 3 comments

Comments

@cheesykyle
Copy link
Contributor

I've secured my app with SSL and everything is working as expected, aside from LiveQueries. I'm accessing my parse-server from an SSL webpage as well and receive the following error from the web console:

https://example.com/ was loaded over HTTPS, but attempted to connect to the insecure WebSocket endpoint 'ws://example.com/parse'. This request has been blocked; this endpoint must be available over WSS

So I assume this is a simple matter of LiveQueries not creating a secure WebSocket connection and providing the correct protocol. Is this something that is being worked on, or how can I ensure I have access to the live query protocol behind ssl.

Thanks!

@cheesykyle
Copy link
Contributor Author

cheesykyle commented May 4, 2016

I've fixed this client-side for the meantime by replacing with the following at line 3653 in parse-latest.js

if (!liveQueryServerURL) {
        var tempServerURL = _CoreManager2['default'].get('SERVER_URL');
        var protocol = 'ws://';
        if (tempServerURL.indexOf('https') === 0) {
          protocol = 'wss://'
        }
        var host = tempServerURL.replace(/^https?:\/\//, '');
        liveQueryServerURL = protocol + host;
        _CoreManager2['default'].set('LIVEQUERY_SERVER_URL', liveQueryServerURL);
}

@andrewimm
Copy link
Contributor

Want to submit a PR for this?

@cheesykyle
Copy link
Contributor Author

PR Submitted!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants