public UpgradeConnection(EndPoint endp, Executor executor, DefaultWebSocketClient client) {
    super(endp, executor);
    this.client = client;
    this.bufferPool = client.getFactory().getBufferPool();
    this.parser = new HttpResponseHeaderParser();

    try {
      this.request = client.getUpgradeRequest();
    } catch (ClassCastException e) {
      client.failed(new RuntimeException("Invalid Upgrade Request structure", e));
    }
  }