relay: close sub when socket is closed

This commit is contained in:
Alex Gleason 2023-08-24 18:43:14 -05:00
parent f9de6932ac
commit 00c531bbff
No known key found for this signature in database
GPG Key ID: 7211D1F99744FBB7
1 changed files with 4 additions and 0 deletions

View File

@ -34,6 +34,10 @@ function connectStream(socket: WebSocket) {
}
};
socket.onclose = () => {
Sub.close(socket);
};
/** Handle client message. */
function handleMsg(msg: ClientMsg) {
switch (msg[0]) {