These are chat archives for IndySockets/Indy

25th
Sep 2016
davidpn
@davidpn
Sep 25 2016 22:27
I know how to make a IPv6 only network.. it's making TIdHTTP work with it that is the problem
I didn't get far over the weekend with diagnosing the problem, however my initial guess is that it simply doesn't switch to IPv6 if IPv4 doesn't work (or cannot detect IPv6 only)
Remy Lebeau
@rlebeau
Sep 25 2016 23:24
Indy does not switch automatically, you have to tell it which IP version to use ahead of time. By default, everything it does uses IPv4 unless told otherwise. In IdCompilerDefines.inc, you can set the default to IPv6 instead (that is what Embarcadero did for their iOS bundled version of Indy). Alternatively, you would have to manually detect the network IP version and then configure Indy accordingly at runtime when making connections.
Since you mention TIdHTTP, I suspect it is treating your URLs as IPv4 unconditionally. For IPv6, you have to wrap hostnames in brackets, eg: http://[hostname]:port/resource. If you get an HTTP redirect to a different hostname, that might switch back to IPv4. I will have to check that.
davidpn
@davidpn
Sep 25 2016 23:29
we also don't want to have to wrap all URLs
"Alternatively, you would have to manually detect the network IP version and then configure Indy accordingly at runtime when making connections" I had been attempting to work out how to do that..
I tested on the weekend with the Indy that is bundled with Delphi.. it doesn't default to IPv6
i.e. Delphi 10.1 Berlin
Remy Lebeau
@rlebeau
Sep 25 2016 23:38
I know for a fact that Embarcadero's bundled version of Indy defaults to IPv6 on iOS, because I remember finding that Embarcadero had made that change without telling me when they shipped it. But either way, TIdHTTP is a special case because of the way it handles URLs internally, so it is probably ignoring any preexisting IP settings. I will have to double check that when I have some time. Other Indy components don't suffer from the issue since they don't handle URLs directly
davidpn
@davidpn
Sep 25 2016 23:38
ok.. it makes sense if TIdHTTP behaves differently
I'll be looking further into it tonight (melbourne time)