Skip to content
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

Unable to connect to server @ https://localhost #135

Closed
r2DoesInc opened this issue Mar 13, 2016 · 14 comments
Closed

Unable to connect to server @ https://localhost #135

r2DoesInc opened this issue Mar 13, 2016 · 14 comments

Comments

@r2DoesInc
Copy link

Make sure these boxes are checked before submitting your issue -- thanks for reporting issues back to Parse Dashboard!

  • [x ] You're running version >=2.1.4 of Parse Server.
  • [ x] You've searched through existing issues. Chances are that your issue has been reported or resolved before.

Environment Setup

localhost setup with self signed cert
parse server and dash running on docker
parse server running at https://localhost. confirmed by checking cloud code.

Steps to reproduce

moved everything over to be running off of https://localhost, install a self singed cert, but my dashboard is not loading the server. I can use the same usrl to interact with my cloud code, and can see the "unauthorized" message at the url on the browser, so i know thats the correct url for the server. the dashboard still errors

Logs/Trace

Note: If you get a browser JS error please run npm run dev. This will provide source maps and a much more useful stack trace.

POST https://localhost/msz/parse/serverInfo net::ERR_CONNECTION_REFUSED

My dashboard loads the server if i change it back to the external url, however the cloud code fails to interact with the database.

@r2DoesInc
Copy link
Author

{"features":{"globalConfig":{"create":false,"read":false,"update":false,"delete":false},"hooks":{"create":false,"read":false,"update":false,"delete":false},"logs":{"level":false,"size":false,"order":false,"until":false,"from":false},"push":{"immediatePush":true},"schemas":{"addField":true,"removeField":true,"addClass":true,"removeClass":true,"clearAllDataFromClass":false,"exportClass":false}},"parseServerVersion":"2.1.5"}

I can even get the serverInfo using https://localhost/msz/parse/serverInfo with curl

@drew-gross
Copy link
Contributor

ERR_CONNECTION_REFUSED usually means a problem connection the server. It might be an issue with your cert setup. For localhost, HTTPS is unnecessary, so I'd recommend simplifying by just using HTTP.

@r2DoesInc
Copy link
Author

I cannot load it over http, the dashboard blocks any unsecure content from being loaded.

@r2DoesInc
Copy link
Author

If there is a way to load the dashboard over https and allow for communication to be done over http to localhost, that would be great., but I get the error.

Mixed Content: The page at 'https://parse.futurehax.org/' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://pserver.futurehax.org/msz/parse/serverInfo'. This request has been blocked; the content must be served over HTTPS.

@r2DoesInc
Copy link
Author

Have just confirmed Safari allows me to use http://localhost, but chrome does not allow loading of mixed content.

@drew-gross
Copy link
Contributor

That dashboard should allow you to use HTTP over localhost, it only disallows HTTP when using a remote IP address.

@r2DoesInc
Copy link
Author

Oh sorry, i had it configured for the other issue. it gives me the same issue with localhost though.

Mixed Content: The page at 'https://parse.futurehax.org/' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://localhost/msz/parse/serverInfo'. This request has been blocked; the content must be served over HTTPS.

You can go to 'https://parse.futurehax.org/ and check it out yourself. it doesnt allow anything over http.

@r2DoesInc
Copy link
Author

Simplified things today and removed the extra mount point.

Mixed Content: The page at 'https://parse.futurehax.org/apps' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://localhost:1337/parse/serverInfo'. This request has been blocked; the content must be served over HTTPS.

Tried without http or https and they wouldnt allow that either. I dont know how else to connect to it

@drew-gross
Copy link
Contributor

Ah, I see. You are using a Parse App on localhost/http, but your dashboard is on https on some remote server. I'd recommend running your dashboard on localhost as well if you are running your app on localhost.

@r2DoesInc
Copy link
Author

I can access the dashboard itself locally, and it will connect to the server over localhost, but i need to be able to access the dashboard externally. I moved to localhost at the suggestion of this thread parse-community/parse-server#411

@r2DoesInc
Copy link
Author

I can get everything working running over https on an external address except for cloud code, which is an integral part of our system. the current suggests for cloud code say to run everything off localhost, but that doesnt help us with our need for an external

@drew-gross
Copy link
Contributor

You should be able to set your server URL to localhost in your Server Config, but still have the server URL be the remote server in your dashboard.

@r2DoesInc
Copy link
Author

awesome, that did it.

@luizfelipetx
Copy link

@r2DoesInc i have success here running dashboard in remote ip and connect dashboard to my parse-server in another server. Booth remote address.

ParseServer is running in 162.193.60.xxxx
ParseDashboard is running in 162.80.54.xxxx

I need made a hack in ParseDashboard directly in code to able dashboard to connect in my server remote.

You can do the same .

Go to this file.

*parse-dashboard/Parse-Dashboard/public/bundles# sudo vim dashboard.bundle.js *

(i run npm locally, if you use global you need found the file dashboard bundle in general this can be found in opt/lib or usr/lib, you need found in your server. )

After found , go to line 36606 , and edit "if ( contains("api.parse...) " to simple if(true) , so now you are able to connect your parse server in your parse dashboard.

To run parse dashboard in any http or https without add allow insecure alltime, you can go to your index.js inside parse dashboard and put in var allowInsecure= 1;

douglasmuraoka pushed a commit that referenced this issue Nov 29, 2019
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