microsoft / cpprestsdk

The C++ REST SDK is a Microsoft project for cloud-based client-server communication in native code using a modern asynchronous C++ API design. This project aims to help C++ developers connect to and interact with services.
Other
8.01k stars 1.66k forks source link

Issues using cpprestsdk on Windows in mixed IPv6/IPv6 networks (Happy Eyeballs) #1114

Open deeringc opened 5 years ago

deeringc commented 5 years ago

We're observing an issue where the WinHTTP-based client inside of cpprestsdk is having issues where a users DNS server is returning a mix of IPv6 & IPv4 addresses on a badly configured network.

If the IPv6 address is not routable we see a 21 second timeout , and then WinHTTP seems to fall back on the IPv4 address (which succeeds immediately).

This seems to indicate that WinHTTP does not support Happy Eyeballs (rfc6555).

Can you confirm whether this is indeed the case? Do consumers have any way to control which DNS results are honoured?

Obviously the network is the source of the issue, and that should be addressed, but users mostly dont have any control over this, and many HTTP stacks do support Happy Eyeballs in order to shield users from this.

Thanks, Chris

garethsb commented 5 years ago

Does netsh interface ipv6 set prefixpolicy help here?

deeringc commented 5 years ago

Thanks for the good suggestion, @garethsb-sony. It works around the problem but it's not something we can set globally on the user's system. We need something that only affects the app in question.