title: Composer very slow, problems connecting to packagist.org with Curl
body: <p>I'm struggling to do a composer update, everytime I try to I get the following error:</p>
  
  <blockquote>
    <p>[Composer\Downloader\TransportException]<br>
    The
    "<a href="https://packagist.org/p/provider-2013%24442e1d5fa0fdbf77855cc363b02499" rel="nofollow noreferrer">https://packagist.org/p/provider-2013%24442e1d5fa0fdbf77855cc363b02499</a>
    4a3e92a2f5099e5138b9c5777ae486703c.json" file could not be downloaded:
    failed to open stream: HTTP request failed!</p>
  </blockquote>
  
  <p>I am in a new location so it may be an issue with the wifi connection or a firewall on the router, although I do not have control over these things, nor do I know how to confirm if this is the case. I've suggested it here just as a possibility.</p>
  
  <p>One thing I have found is that it does NOT seem to be related to using composer, merely loading the packagist.org url in the browser is very slow.</p>
  
  <p>To try and investigate this further I did a verbose curl, the output of which is here:</p>
  
  <pre><code>curl -Ov "https://packagist.org/p/provider-2016%24e91d8a4de280998eb052b8c02ed0533b247e992c67ab15cfcb3f5aee95f4839d.json" 
    % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                   Dload  Upload   Total   Spent    Left  Speed
    0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  *   Trying 144.217.203.53...
  *   Trying 2607:5300:60:7113::3...
  * Immediate connect fail for 2607:5300:60:7113::3: No route to host
  * Connected to packagist.org (144.217.203.53) port 443 (#0)
    0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  * TLS 1.2 connection using TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
  * Server certificate: packagist.org
  * Server certificate: DigiCert SHA2 Secure Server CA
  * Server certificate: DigiCert Global Root CA
  &gt; GET /p/provider-2016%24e91d8a4de280998eb052b8c02ed0533b247e992c67ab15cfcb3f5aee95f4839d.json HTTP/1.1
  &gt; Host: packagist.org
  &gt; User-Agent: curl/7.49.1
  &gt; Accept: */*
  &gt; 
    0     0    0     0    0     0      0      0 --:--:--  0:00:01 --:--:--     0&lt; HTTP/1.1 200 OK
  &lt; Server: nginx
  &lt; Date: Tue, 23 May 2017 12:31:47 GMT
  &lt; Content-Type: application/json
  &lt; Content-Length: 2080782
  &lt; Connection: keep-alive
  &lt; Vary: Accept-Encoding
  &lt; Last-Modified: Tue, 23 May 2017 12:12:30 GMT
  &lt; Vary: Accept-Encoding
  &lt; ETag: "5924272e-1fc00e"
  &lt; Accept-Ranges: bytes
  &lt; 
  { [16093 bytes data]
   39 2032k   39  799k    0     0   7677      0  0:04:31  0:01:46  0:02:45  6267^C
  </code></pre>
  
  <p>It seems to fail a few times and then finally starts working, although estimated time is 4 minutes and 31 seconds which is obviously not what you would expect for a 2MB file.</p>
  
  <p>I've done alot of Googling and there are examples of this error and similar all over the place, but none of them seem relevant.</p>
  
  <p>I was originally using this within Vagrant and have been debugging on the assumption that it was Vagrant related for ages. But the slow connection via Curl and the browser has ruled this out and left me at a loss. Hopefully someone can shed some light.</p>
  
  <p>Incase it makes any difference the two repositories i've been testing this on are both Laravel, 5.1 and 5.4 respectively.</p>