diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ed66436..88d3fa9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,7 +14,7 @@ jobs: strategy: matrix: otp_vsn: [20, 21, 22, 23] - os: [ubuntu-latest] + os: [ubuntu-20.04] steps: - uses: actions/checkout@v2 - uses: erlef/setup-beam@v1.7.0 diff --git a/rebar.config b/rebar.config index 58a2d43..2d184ed 100644 --- a/rebar.config +++ b/rebar.config @@ -23,7 +23,7 @@ %% == Dependencies == {deps, [ - {gun, "1.3.3"}, + {gun, "2.0.0"}, {jsx, "3.0.0"}, {base64url, "1.0.1"} ]}. diff --git a/rebar.lock b/rebar.lock index be37c6e..08bcda6 100644 --- a/rebar.lock +++ b/rebar.lock @@ -1,17 +1,17 @@ {"1.2.0", [{<<"base64url">>,{pkg,<<"base64url">>,<<"1.0.1">>},0}, - {<<"cowlib">>,{pkg,<<"cowlib">>,<<"2.7.3">>},1}, - {<<"gun">>,{pkg,<<"gun">>,<<"1.3.3">>},0}, + {<<"cowlib">>,{pkg,<<"cowlib">>,<<"2.12.0">>},1}, + {<<"gun">>,{pkg,<<"gun">>,<<"2.0.0">>},0}, {<<"jsx">>,{pkg,<<"jsx">>,<<"3.0.0">>},0}]}. [ {pkg_hash,[ {<<"base64url">>, <<"F8C7F2DA04CA9A5D0F5F50258F055E1D699F0E8BF4CFDB30B750865368403CF6">>}, - {<<"cowlib">>, <<"A7FFCD0917E6D50B4D5FB28E9E2085A0CEB3C97DEA310505F7460FF5ED764CE9">>}, - {<<"gun">>, <<"CF8B51BEB36C22B9C8DF1921E3F2BC4D2B1F68B49AD4FBC64E91875AA14E16B4">>}, + {<<"cowlib">>, <<"58B73B75BEE32295A3E2CB37CD73D7B41E8B0C9C9A235869E6BFCCE3FC1A63AA">>}, + {<<"gun">>, <<"2326BC0FD6D9CF628419708270D6FE8B02B8D002CF992E4165A77D997B1DEFD0">>}, {<<"jsx">>, <<"20A170ABD4335FC6DB24D5FAD1E5D677C55DADF83D1B20A8A33B5FE159892A39">>}]}, {pkg_hash_ext,[ {<<"base64url">>, <<"F9B3ADD4731A02A9B0410398B475B33E7566A695365237A6BDEE1BB447719F5C">>}, - {<<"cowlib">>, <<"1E1A3D176D52DAEBBECBBCDFD27C27726076567905C2A9D7398C54DA9D225761">>}, - {<<"gun">>, <<"3106CE167F9C9723F849E4FB54EA4A4D814E3996AE243A1C828B256E749041E0">>}, + {<<"cowlib">>, <<"FA8A335B7C61263317C6214676CFB8C448AE9C36BAD3D98DF9CB166265940FD1">>}, + {<<"gun">>, <<"6613CB7C62930DC8D58263C44DDA72F8556346BA88358FC929DCBC5F76D04569">>}, {<<"jsx">>, <<"37BECA0435F5CA8A2F45F76A46211E76418FBEF80C36F0361C249FC75059DC6D">>}]} ]. diff --git a/src/apns_connection.erl b/src/apns_connection.erl index 75fea77..d184803 100644 --- a/src/apns_connection.erl +++ b/src/apns_connection.erl @@ -230,9 +230,10 @@ open_origin(internal, _, #{connection := Connection} = StateData) -> {next_state, open_common, StateData, {next_event, internal, { Host , Port - , #{ protocols => [http2] - , transport_opts => TransportOpts - , retry => 0 + , #{ protocols => [http2] + , tls_opts => TransportOpts + , http2_opts => #{keepalive => 5000} + , retry => 0 }}}}. -spec open_proxy(_, _, _) -> _. @@ -244,6 +245,7 @@ open_proxy(internal, _, StateData) -> , ProxyPort , #{ protocols => [http] , transport => tcp + , http_opts => #{keepalive => infinity} , retry => 0 }}}}.