1

Privoxyを使用してアプリを作成します

forward /spacemap/xml/maps.php 127.0.0.1:9002

次はC#で

TcpListener tcpListener = new TcpListener(IPAddress.Any, 9002);
tcpListener.Start();
while (true)
{
TcpClient tcpClient = tcpListener.AcceptTcpClient();
HTTP HTTP = new HTTP(tcpClient);
HTTP.Read();
}

メソッドHTTP.Read()では、リクエストからこのファイル (/spacemap/xml/maps.php) へのすべてのヘッダーを読み取り、正常に動作します。

しかし、requestURL(good) を取得してその URL を開こうとすると、何も起こりません。

WebClient webClient = new WebClient();
string download = webClient.DownloadString("http://example.com/spacemap/xml/maps.php");
Console.WriteLine(download);

しかし、ダウンロード変数は空です。(ウェブブラウザのリンクは正常に機能します)。

私は HttpWebRequest、WebRequest、WebClient を試していますが、他のリンクは問題なく動作します。

何か案は?

4

0 に答える 0