Sending a close code of 1000 or 1001 invalidates gateway sessions. Instead, we use close code 1005 (no error specified)