title: I send TCP request to HTTP server - but don't have any response
body: <p>Using boost-asio I prepared simple code:</p>
  
  <pre><code>asio::io_service io_service;
  
  asio::ip::tcp::socket s(io_service);
  asio::ip::tcp::resolver resolver(io_service);
  asio::connect(s, resolver.resolve({ "aire.pl", "80" }));
  
  cout &lt;&lt; "connected" &lt;&lt; endl;
  
  string request = "GET http://aire.pl/ HTTP/1.1";
  size_t request_length = std::strlen(request.c_str());
  asio::write(s, asio::buffer(request, request_length));
  
  cout &lt;&lt; "packet sent" &lt;&lt; endl;
  
  char reply[1024];
  size_t reply_length = asio::read(s, asio::buffer(reply, request_length));
  std::cout &lt;&lt; "Reply is: ";
  std::cout.write(reply, reply_length);
  std::cout &lt;&lt; "\n";
  </code></pre>
  
  <p>Everything seems to work fine, because using tcp-dump I can see my packets that the program has sent:</p>
  
  <p><a href="https://i.stack.imgur.com/a3rag.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/a3rag.png" alt="enter image description here"></a></p>
  
  <p>But I don't have any response. The one interesting fact is that, if HTTP server is nginx it works ok! In this example, the HTTP server is Apache2. What's wrong?</p>