title: Can JMeter support HTTP method CONNECT
body: <p><a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/CONNECT" rel="nofollow noreferrer">HTTP method CONNECT</a> is part of available HTTP methods, </p>
  
  <p>In Fiddler HTTP CONNECT is also saved and can be export to HAR format and then converted to JMeter script, </p>
  
  <p>In JMeter those <a href="http://jmeter.apache.org/usermanual/component_reference.html#HTTP_Request" rel="nofollow noreferrer">HTTP Request</a> are failing,for example request <code>CONNECT http://graph.facebook.com:443/</code></p>
  
  <p>With the following error:</p>
  
  <pre><code>org.apache.http.client.ClientProtocolException
      at org.apache.http.impl.client.AbstractHttpClient.doExecute(AbstractHttpClient.java:839)
      at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83)
      at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.executeRequest(HTTPHC4Impl.java:697)
      at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sample(HTTPHC4Impl.java:455)
      at org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:74)
      at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1189)
      at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1178)
      at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:490)
      at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:416)
      at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:250)
      at java.lang.Thread.run(Unknown Source)
  Caused by: org.apache.http.ProtocolException: The server failed to respond with a valid HTTP response
      at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:149)
      at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:56)
      at org.apache.http.impl.io.AbstractMessageParser.parse(AbstractMessageParser.java:259)
      at org.apache.http.impl.AbstractHttpClientConnection.receiveResponseHeader(AbstractHttpClientConnection.java:286)
      at org.apache.http.impl.conn.DefaultClientConnection.receiveResponseHeader(DefaultClientConnection.java:257)
      at org.apache.jmeter.protocol.http.sampler.hc.ManagedClientConnectionImpl.receiveResponseHeader(ManagedClientConnectionImpl.java:199)
      at org.apache.jmeter.protocol.http.sampler.MeasuringConnectionManager$MeasuredConnection.receiveResponseHeader(MeasuringConnectionManager.java:212)
      at org.apache.http.protocol.HttpRequestExecutor.doReceiveResponse(HttpRequestExecutor.java:273)
      at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:125)
      at org.apache.http.impl.client.DefaultRequestDirector.tryExecute(DefaultRequestDirector.java:684)
      at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:486)
      at org.apache.http.impl.client.AbstractHttpClient.doExecute(AbstractHttpClient.java:835)
      ... 10 more
  </code></pre>
  
  <p>CONNECT isn't mention in HTTP Request component:</p>
  
  <blockquote>
    <p>GET, POST, HEAD, TRACE, OPTIONS, PUT, DELETE, PATCH (not supported for JAVA implementation). With HttpClient4, the following methods related to WebDav are also allowed: COPY, LOCK, MKCOL, MOVE, PROPFIND, PROPPATCH, UNLOCK, REPORT, MKCALENDAR, SEARCH.</p>
  </blockquote>
  
  <p>Can CONNECT method be execute in JMeter? if not what can be the fix? change to other method or only remove those requests from script?</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>I also failed in HTTP Raw Request to execute similar CONNECT method.errors: <code>Response message: java.nio.channels.AsynchronousCloseException</code> or <code>java.net.ConnectException: Connection refused: connect</code></p>
  
  <p>I also failed to change to GET or https protocol.</p>