-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
[Resolved, but with possible security hole] Cordoba client can't access http://xx.xx.xx.xx:3000/graphql. Apollo server CORS config problem #1662
Comments
Resolved ¡¡¡¡¡ Adding cors npm package https://www.npmjs.com/package/cors and modify packages/vulcan-lib/lib/server/apollo_server.js add modify line: Now Cordoba/Android client runs. NOTE 1: NOTE 2: I think that cors using '*' is a opened security hole, maybe reading options to using with cors from another vulcan config file will be good. |
Hi, The weird part is that on Cordova request are sent to an IP that is'nt localhost, can this be solved ? By default the meteor DDP server is whitelisted. I guess this adress correspond the Apollo server, that isn't whitelisted by default. Maybe a |
Maybe we could also ask MDG directly how to properly configure Apollo server to work with Meteor+Cordova? |
Maybe this is not the greatest solution but setting cors to "*" is a bad idea because some warnings are thrown at least for me. I went with this solution:
This is done when the apollo server is started. |
We now have a cors setting, either enabling all (public api) or a whitelist of domain
|
I'm trying to launch Vulcan from android mobile.
But I got an error into javascript remote client console:
OPTIONS http://192.168.43.20:3000/graphql 405 (Method Not Allowed)
Note: android/Cordova apk client was compile using below command.
meteor build ../out_apk --debug --verbose --server=http://192.168.43.20:3000
I think maybe is a bug like comment here -> apollographql/apollo-client#529
But I can not find into Vulcan code the way to pass to createApolloServer() function CORS options to enable it from an external ip or server.
The text was updated successfully, but these errors were encountered: