title: Ftp list directory behind a http proxy
body: <p>I'm trying to list the files from a ftp address using FtpWebRequest class</p>
  
  <pre><code>    private IEnumerable&lt;ResourceInfo&gt; EnumerateResources(Stream stream)
      {
          StreamReader reader = new StreamReader(stream);
          string line = null;
          while ((line = reader.ReadLine()) != null)
          {
              yield return new ResourceInfo(this, line);
          }
      }
  
      public override IReadOnlyList&lt;ResourceInfo&gt; GetResources()
      {
          FtpWebRequest req = (FtpWebRequest)WebRequest.Create(Url);
          req.Method = WebRequestMethods.Ftp.ListDirectory;
  
          req.Credentials = Credentials;
          using (var resp = (FtpWebResponse)req.GetResponse())
          {
              using (var stream = resp.GetResponseStream())
              {
                  return EnumerateResources(stream).ToReadOnly();
              }
          }
      }
  </code></pre>
  
  <p>This works ok in most cases.
  But when i'm behind an HTTP proxy the content of the response stream contains a HTML page
  that lists the files inside <strong>a</strong> tags. Is there any elegant way to treat this or should i just try to parse the HTML by hand.</p>