ninenines / gun

HTTP/1.1, HTTP/2, Websocket client (and more) for Erlang/OTP.
ISC License
891 stars 232 forks source link

gun-2.0.0-rc.1 - HTTP/2 connection process exits after 2 hours of no-use? #263

Closed jainygaurav closed 3 years ago

jainygaurav commented 3 years ago

Is there a gun config option that would make it work like 1.3.3 (i.e. gun-1.3.3does not disconnect after 2 hours of no-use)?

Please help.

essen commented 3 years ago

This is probably the server closing the connection because Gun no longer sends pings by default (see keepalive option). But I'm not sure I understand, is there a problem? I don't think there is. Gun properly reconnects and you haven't lost any requests.

jainygaurav commented 3 years ago

@essen thank you for confirming. I was able to resolve this issue by:

{ Host
                           , Port
                           , #{ protocols      => [http2]
                              , tls_opts => TransportOpts
                              , http_opts => #{keepalive => 5000}
                              , http2_opts => #{keepalive => 5000}
                              , retry          => 0
                              }}