This fixes an inconsistency between bandit and cowboy. When closing the socket connection and using cowboy, we'd receive a code 1005, but when running with bandit we'd receive code 1000. LiveView currently reacts to code 1000 by doing a failsafe reload, therefore you cannot close the socket when using bandit without reloading the page.
This should be the correct way to do it: removing the server close handler when the reason for closing is the client intentionally disconnecting.
This fixes an inconsistency between bandit and cowboy. When closing the socket connection and using cowboy, we'd receive a code 1005, but when running with bandit we'd receive code 1000. LiveView currently reacts to code 1000 by doing a failsafe reload, therefore you cannot close the socket when using bandit without reloading the page.
This should be the correct way to do it: removing the server close handler when the reason for closing is the client intentionally disconnecting.