-1

PostGraphile v4.9.2 server listening on port 5001

‣ GraphQL API: http://0.0.0.0:5001/graphql

how can i change http to https. i mean, i want https://0.0.0.0:5001/graphql

because, i am getting error while debugging my ionic capacitor app for android

E/Capacitor/Console: File: http://localhost/vendor-es2018.js - Line 41539 - Msg: ERROR Error: Http failure response for http:// mydomain .com:5001/graphql: 0 Unknown Error

i think it is about http problem but as you see it is unknown error. Thanks in advance

johnborges
  • 2,422
  • 20
  • 33
  • I'm not sure that causes the unknown error: you can not use IP V4 address 0.0.0.0. That's a special adress. If you listen on a socket for 0.0.0.0, that means: Listen to all ip addresses (interfaces) the operating system is aware of.According to the error message the system translates 0.0.0.0 to `http:// mydomain .com:5001/graphql`. There is an space character where it should not be. Look for a specific address of your computer, or use localhost. ` http://localhost:5001/graphql` or (just an example) `http://192.168.0.100:5001/`. Localhost only works if server and client are on the same machine. – Peter Paul Kiefer Jan 11 '21 at 09:28
  • PostGraphile v4.10.0 server listening on port 5001 ‣ GraphQL API: http://192.168.38.4:5001/graphql (database is in the same ip) – Mustafa Ülker Jan 11 '21 at 12:57
  • Sorry, I don't know what you try to tell us with the last comment. Why is the database ip relevant? And, I had not read the question carefully. You wrote about an Android app. Connecting from a phone or tablet to a PC only works if you configure the App with the right IP address of the server: Let's say `http://192.168.38.4:5001/graphql`. That only works if the phone/tablet uses the same IP subnet. I guess `192.168.38.0/24` in your case: i.e. the IP address of the mobile is `192.168.38.xxx` with xxx is something between 1 and 254 including 1 and 254. – Peter Paul Kiefer Jan 11 '21 at 16:24
  • If you use a simulator on the same PC (Debug??) you should be sure the simulator is configured with an IP address in the same subnet. – Peter Paul Kiefer Jan 11 '21 at 16:25

1 Answers1

-1

i found the solution here: How to allow all Network connection types HTTP and HTTPS in Android (9) Pie? i allowed http requests in manifest.xml and i added networkSecurityConfig.xml Thank you all