On Mon, 22 Feb 2016 13:14:31 +0100, Sönke Ludwig wrote:

Am 22.02.2016 um 04:30 schrieb John More:

Two questions:

  1. How to set the address.family so requestHTTP will use a ipv4 address.

Currently this can't be accessed. A way to add this with minimal changes
would be to control the DNS resolver using the address family of the
HTTPClientSettings.networkInterface. By default, this is AF_UNKNOWN,
so the default behavior would stay unaffected.

However, the network interface might be IPv6, while there could still be
an IPv4 gateway in-between, so it probably makes more sense to add a new
settings field for this.

  1. Where do I find the enumeration for the address.family using AFINET results in the following compiler error :source/app.d(8,70): Error: undefined identifier 'AFINET'.

AF_INET is in the system headers somewhere in
core.sys.posix/core.sys.windows. However, you can also use the
AddressFamily enum in std.socket.

  1. How would I make it work using the web framework and/or the REST Interface.

I'll add a RestInterfaceSettings.httpClientSettings to enable
controlling the HTTP requests.

Thanks for the quick reply. I can make this work for now simply by using the resolveHost and take the address I get the make the request. I did look at the Linux host command which actually requests both the ipv4 and ipv6 addresses. Perhaps both should be returned and then allow the user to set a precedence and if that fails use the other.

Thanks again.