Ejemplo n.º 1
0
        private void CreateWebSocketClient()
        {
            if (ws != null && ws.IsAlive)
                return;

            ws = new WebSocket(location.Text);

            connect.Enabled = false;
            setHeaders.Enabled = false;
            proxyButton.Enabled = false;
            location.ReadOnly = true;

            ws.SetHeaders(headers);
            ws.SetProxy(proxyUrl, string.Empty, string.Empty);
            ws.OnError += Ws_OnError;
            ws.OnClose += Ws_OnClose;
            ws.OnMessage += Ws_OnMessage;
            ws.OnOpen += Ws_OnOpen;

            ws.Connect();
        }