-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
HTTPClientSession fails with "Connection Refused" on localhost #2226
Comments
Could you try to use the ip address with quad number: 127.0.0.1 instead of localhost... |
Hi. We've noticed that ipv dotted decimal works due to localhost address
translation that goes wrong. Will look into it on Monday. Behavior of 1.90
better than 1.78. I will modify the issue. Error changed in 1.90
…On 17 Mar 2018 14:07, "zosrothko" ***@***.***> wrote:
Could you try to use the ip address with quad number: 127.0.0.1 instead of
localhost...
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#2226 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AIC6kKTMAxEygmw3NZOMfMTKT1-7--u_ks5tfPxkgaJpZM4StwEG>
.
|
"localhost" is resolving in a IPV6 address, that's why the dotted ip address works |
I ran into this issue with version 1.8.1. I have a server and it was only listening on IPv4 address. The DNS for FQDN of the server returns 2 entries, IPv6 followed by IPv4. Poco's HTTPClientSession seems to try only the first address which happens to be IPv6, throws connection refused error (which is true) and that's it. I have not run into the same problem with other clients like curl/chrome/firefox/ie - either by chance (maybe host lookup in those cases always gets IPv4 address first) or intentionally going through through every address, these clients always reach the server. My question is, is this considered a bug in Poco? Should Poco HTTPClientSession try all addresses returned by DNS before declaring connection refused? |
Should it try all addresses? In my opinion, yes. We've managed to find a
workaround without change to the library. I might post it tomorrow. Can't
remember the exact details now. I can recall the ipv6 being selected and
rejected though.
…On Wed, 04 Apr 2018, 23:56 budric ***@***.***> wrote:
I ran into this issue with version 1.8.1. I have a server and it was only
listening on IPv4 address. The DNS for FQDN of the server returns 2
entries, IPv6 followed by IPv4. Poco's HTTPClientSession seems to try only
the first address which happens to be IPv6, throws connection refused error
(which is true) and that's it.
I have not run into the same problem with other clients like
curl/chrome/firefox/ie - either by chance (maybe host lookup in those cases
always gets IPv4 address first) or intentionally going through through
every address, these clients always reach the server.
My question is, is this considered a bug in Poco? Should Poco
HTTPClientSession try all addresses returned by DNS before declaring
connection refused?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#2226 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AIC6kD0DCrn_z0XDkIweCrt8rsx4zfF9ks5tlUF-gaJpZM4StwEG>
.
|
The is a know problem. One solution could be to use a global variable stating which should go in first in the DNS list, either IPV4 or IPV6, defaulted to IPV6. See #1871 |
Is there a correct solution of this problem? |
In /etc/hosts, I changed the line |
This issue is stale because it has been open for 365 days with no activity. |
Expected behavior
Actual behavior
Steps to reproduce the problem (from https://ideone.com/CE0R6j)
POCO version
Poco 1.7.8: "Host not found"
Poco 1.9.0 "Connection Refused"
Compiler and version
Visual Studio 2017
Operating system and version
< Windows 10
Other relevant information
Using 127.0.0.1
Using localhost
This SO article might be relevant
The text was updated successfully, but these errors were encountered: