Skip to content

Commit

Permalink
Merge pull request #35 from travelping/new_hackney
Browse files Browse the repository at this point in the history
Support new hackney
  • Loading branch information
GalaxyGorilla authored Nov 16, 2016
2 parents 6efe4c1 + c40c851 commit 00ba25a
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/exometer_report_influxdb.erl
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,18 @@ connect(Proto, Host, Port, Username, Password) when ?HTTP(Proto) ->
_ -> [{basic_auth, {Username, Password}}]
end ++ [{pool, false}],
Transport = case Proto of
http -> hackney_tcp_transport;
https -> hackney_ssl_transport
http ->
code:load_file(hackney_tcp),
case code:is_loaded(hackney_tcp) of
true -> hackney_tcp;
_ -> hackney_tcp_transport
end;
https ->
code:load_file(hackney_ssl),
case code:is_loaded(hackney_ssl) of
true -> hackney_ssl;
_ -> hackney_ssl_transport
end
end,
hackney:connect(Transport, Host, Port, Options);
connect(udp, _, _, _, _) -> gen_udp:open(0);
Expand Down

0 comments on commit 00ba25a

Please sign in to comment.