ninenines / gun

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

ws_upgrade doesn't alter keepalive value #220

Open Gazler opened 4 years ago

Gazler commented 4 years ago

Given the following code snippet:

gun:open(Host, Port, #{})
gun:ws_upgrade(Pid, Url, [], #{keepalive=> infinity})

The keepalive continues to use the default value, and a keepalive is sent after 5 seconds.

The following correctly sets the keepalive value:

gun:open(Host, Port, #{ws_opts => #{keepalive => infinity}})
gun:ws_upgrade(Pid, Url, [], #{})
essen commented 1 year ago

This is linked (conceptually) to handling of keepalive in tunnels. I'll leave it for after 2.0 as it is not a small change.