Prefer IPv4 by default. Use the option `{prefer_ipv6, true}` to force ibrowse to use ipv6 where available.
diff --git a/CHANGELOG b/CHANGELOG
index 7240b17..db72b27 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,6 +1,9 @@
CONTRIBUTIONS & CHANGE HISTORY
==============================
+21-09-2018 - v4.4.2
+ * Fix for #163 - default to using IPv4
+
23-08-2018 - v4.4.1
* Fixes to TLS socket handling (PR#163)
* Fix ipv6 address family handling (PR#155)
diff --git a/README.md b/README.md
index d2d42e7..5080bf2 100644
--- a/README.md
+++ b/README.md
@@ -7,7 +7,7 @@
**Comments to:** chandrashekhar.mullaparthi@gmail.com
-**Current Version:** 4.4
+**Current Version:** 4.4.2
**Latest Version:** git://github.com/cmullaparthi/ibrowse.git
diff --git a/src/ibrowse.app.src b/src/ibrowse.app.src
index 7702e80..5882ff2 100644
--- a/src/ibrowse.app.src
+++ b/src/ibrowse.app.src
@@ -1,6 +1,6 @@
{application, ibrowse,
[{description, "Erlang HTTP client application"},
- {vsn, "4.4.1"},
+ {vsn, "4.4.2"},
{registered, [ibrowse_sup, ibrowse]},
{applications, [kernel,stdlib]},
{env, []},
diff --git a/src/ibrowse_http_client.erl b/src/ibrowse_http_client.erl
index 5faf074..e59228c 100644
--- a/src/ibrowse_http_client.erl
+++ b/src/ibrowse_http_client.erl
@@ -605,12 +605,18 @@
get_sock_options(Host, Options, SSLOptions) ->
Caller_socket_options = get_value(socket_options, Options, []),
- Ipv6Options = case is_ipv6_host(Host) of
- true ->
- [inet6];
- false ->
- []
- end,
+ PreferIPv6 = get_value(prefer_ipv6, Options, false),
+ Ipv6Options = case PreferIPv6 of
+ true ->
+ case is_ipv6_host(Host) of
+ true ->
+ [inet6];
+ false ->
+ []
+ end;
+ false ->
+ []
+ end,
Other_sock_options = filter_sock_options(SSLOptions ++ Caller_socket_options ++ Ipv6Options),
case lists:keysearch(nodelay, 1, Other_sock_options) of
false ->