ad))
                });
            }
        }

        if (window.location.protocol == 'https:') {
            var url = 'wss://' + window.location.host + '/host';
        } else {
            var url = 'ws://' + window.location.host + '/host';
        }

        const toGameServer = new WebSocket(url)

        toGameServer.onmessage = function(event) {
            let payload = JSON.parse(event.data);

            let name = 'recv_' + payload.tag;
            let port = gameHost.ports[name];
           