From cf1b0a49f13f2550cad1b32ef4e4820b4c26bcf1 Mon Sep 17 00:00:00 2001 From: Arlo Breault Date: Fri, 18 Mar 2016 14:22:34 -0700 Subject: [PATCH] Close connections before unloading Noticed a long delay after the window closed before the datachannel timed out. 2016/03/18 13:53:16 Traffic Bytes (in|out): 202576 | 8087 2016/03/18 13:58:10 WebRTC: DataChannel.OnClose [remotely] --- proxy/snowflake.coffee | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/proxy/snowflake.coffee b/proxy/snowflake.coffee index eff96de..7e26481 100644 --- a/proxy/snowflake.coffee +++ b/proxy/snowflake.coffee @@ -226,4 +226,8 @@ window.onbeforeunload = -> return CONFIRMATION_MESSAGE null +window.onunload = -> + pair.close() for pair in snowflake.proxyPairs + null + window.onload = init if window