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

HTTP [GET] and [POST] - "getaddrinfo failed!" error when hosted on linux webserver #9624

Closed
kivabolt opened this issue Jul 12, 2017 · 3 comments

Comments

@kivabolt
Copy link

kivabolt commented Jul 12, 2017

Operating system or device - Godot version:
Running with Godot v2.1.3.stable.official

Issue description:
I'm playing around with simple GET and POST requests based off this tutorial:(http://docs.godotengine.org/en/stable/learning/features/networking/http_client_class.html)

Function 1: GET
On load, I have it connect to a site to make the GET request and it should return the user info (kivabolt) - [http://meehak.com/squared.php]

Function 2: POST
The second function I have is to POST to a different PHP page with a user's input and two hardcoded variables - [http://meehak.com/uploadUserResult.php]
--> to test the POST, i created a different page for manually submitting results (uploadUser.php)[http://meehak.com/uploadUser.php]

So when I test the project locally or export the project to a windows / desktop executable, the http requests (GET & POST) execute and have no issues connecting to the URL.

Problem #1 : When I upload the exported HTML5 project and host it on a server, I keep getting the error below:
ERROR: At: drivers/unix/ip_unix.cpp:106:_resolve_hostname() - getaddrinfo failed!

Has anyone else ran into this problem? I'm stuck and have no idea what to try next.
I'm hosted via HostGator, no SSL (though I have tried it with an SSL site and hit the same issue)

[Github Repository]

[httpfun running on server]

@Faless
Copy link
Collaborator

Faless commented Aug 10, 2017

Networking does not work for HTML export (at least in 2.1 branch).
I found the reason for the getaddrinfo failed error, we must specifically unset AI_NUMERICHOST which seems to be on by default, see their code for reference .

Sadly the subsequent socket creation fails anyway (should be converted to websockets by emscripten for what I understand, but it fails when calling ioctl somewhere, apparently when setting FIONBIO but I'm still unable to properly pinpoint where).

I'm still working on it, but in case I end up not having enough time at least we have this comment for reference.

EDIT: I did the tests on 2.1 branch, I'll check the status in 3.0 too

@Faless
Copy link
Collaborator

Faless commented Aug 10, 2017

As a followup. in 3.0 when exporting using webassembly the tcp sockets gets converted as expected to websockets connections with Sec-WebSocket-Protocolheader as binary (so it should work, I'm still trying to find a server that supports Sec-WebSocket-Protocol).

In this case though for HTTPClient to work, we would want to implement it as an XMLHttpRequest I guess,

@kubecz3k
Copy link
Contributor

closing since, according to #14888 this is working in a master branch

@akien-mga akien-mga added this to the 3.0 milestone Feb 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants