65.9K
CodeProject 正在变化。 阅读更多。
Home

ASProxy:利用 ASP.NET 的强大功能实现隐形上网

starIconstarIconstarIconstarIcon
emptyStarIcon
starIcon

4.77/5 (61投票s)

2006年4月28日

MPL

15分钟阅读

viewsIcon

1138694

downloadIcon

1735

一个强大的网络代理,让您畅通无阻地访问被屏蔽的网页。

ASProxy:利用 ASP.NET 的强大功能实现隐形上网

使用 ASProxy 畅游网络

当前版本:5.5 Beta4

注意:所有下载均来自外部网站(SourceForge)。

ASProxy preview

目录

引言

使用这个用 ASP.NET 2 编写的工具,您可以轻松绕过过滤器,查看您想要的网页,甚至下载文件。

特点

  • 自由畅游网页
  • 完全支持 AJAX 和 Web 2.0 网站。
  • 支持大多数登录表单
  • 下载工具,让用户能够下载任何类型的文件 
  • 支持断点续传下载
  • 支持提交表单以发送注册数据和上传文件
  • 支持 Cookie
  • 能够显示未知编码的页面,并强制使用 UTF-8 编码显示
  • 支持 JavaScript 和级联样式表 (CSS) 文件
  • 支持 JavaScript 和 script 标签
  • 支持内联框架和框架集页面
  • 支持页面压缩以实现快速接收
  • 能够在状态栏显示原始 URL 和图片
  • 在浏览器标题栏显示页面标题
  • 支持由 JavaScript 创建的动态内容。
  • 自动更新使代理保持最新
  • 密码保护,防止陌生人访问;适合个人使用

安装

Somee 安装指南(面向新手用户)

您首先需要拥有一个支持 ASP.NET 的免费 Web 托管。我推荐 www.somee.com。要获取免费套餐,请访问以下地址:
http://www.somee.com/FreePackage.aspx

创建您的网站后,您需要一个 FTP 工具,如 FlashFXP 或 CuteFTP,才能将文件传输到服务器。

打开您的 FTP 软件并单击“连接”按钮,会弹出一个新窗口。在“主机”字段中输入您的网站名称。例如:Name.somee.com

然后您必须输入用户名和密码。接受对话框。登录后,如果 there is any folder there,请导航。如果没有,请继续阅读本指南。

Somee 支持 ASP.NET 2 的设置

1- 前往 www.somee.com
2- 登录您的账户。
3- 进入控制面板并点击“Web”按钮。
4- 在接下来的“常规信息”页面,会显示您的账户信息。在“常规信息”标题的上方,有四个按钮。点击最后一个名为“IIS 设置”的按钮。
5- 在新打开的页面的底部,您将看到一个下拉列表,标题为“ASP.NET 版本”。选择“2.0.50727”。然后点击“更新”按钮!

将文件上传到您自己的网站

请注意,您必须将“PrecompiledWeb”文件夹中的所有文件复制到服务器,而不是复制文件夹本身。现在您的代理已准备就绪!要查看根据本指南创建的示例网站,请访问:
http://asproxy3.somee.comhttp://asproxy35.somee.com

ASProxy 配置

大多数配置存储在 Web.Config 文件中的 appSettings 部分。

以下是默认配置:

<appSettings>
    <add key=&quot;WebProxyMode&quot; value=&quot;0&quot;/>
    <add key=&quot;WebProxyHost&quot; value=&quot;0.0.0.0&quot;/>
    <add key=&quot;WebProxyPort&quot; value=&quot;8080&quot;/>

    <add key=&quot;ASProxyLoginNeeded&quot; value=&quot;false&quot;/>
    <add key=&quot;ASProxyLoginUser&quot; value=&quot;admin&quot;/>
    <add key=&quot;ASProxyLoginPassword&quot; value=&quot;admin&quot;/>

    <add key=&quot;ASProxyServerPort&quot; value=&quot;8080&quot;/>
    <add key=&quot;ASProxyServerAdminPassword&quot; value=&quot;&quot;/>

    <add key=&quot;ErrorLogEnabled&quot; value=&quot;false&quot;/>

    <add key=&quot;ASProxyAutoUpdateEnabled&quot; value=&quot;false&quot;/>
    <add key=&quot;ASProxyAutoUpdateInfoUrl&quot; value=&quot;http://asproxy.sourceforge.net/update/autoupdate.xml&quot;/>
</appSettings>

自动更新

ASProxy 的一项新功能是自动更新,它会根据您的偏好自动更新代理。

此功能默认禁用。要启用它,请打开“Web.Config”文件,在“appSettings”部分找到“ASProxyAutoUpdateEnabled”键。然后将其值更改为“true”。就是这样!

启用此功能后,ASProxy 将每 3 周检查一次“ASProxyAutoUpdateInfoUrl”键中输入的 URL 是否有更新。
如果有新版本可用,它将下载更新并自行安装。

您可能已经注意到,您可以在“ASProxyAutoUpdateInfoUrl”键中更改更新信息的位置。但请记住,输入的 URL 必须存在且信息文件的格式必须正确,否则更新将失败。

私有代理

通过此新功能,您可以阻止其他人访问您的代理网站。这对于个人网站来说是一项有价值的选项,可以摆脱滥用者并节省带宽。要启用此功能,请遵循以下说明:

打开“Web.Config”文件,然后转到“appSettings”部分。
找到“ASProxyLoginNeeded”键,然后将其值更改为“true”。
要指定用户名;找到“ASProxyLoginUser”键并将其“value”更改为您想要的用户名。
要指定密码;找到“ASProxyLoginPassword”键并将其“value”更改为您想要的密码。

启用此设置后,任何未经授权的用户都将被重定向到 login.aspx 页面。如果用户名和密码匹配,他们将获得 ASProxy 的访问权限。

通过网络代理访问网络

在某些网络结构中,Web 服务器位于代理服务器后面,Web 服务器无法直接访问 Internet。需要配置 Web 应用程序才能访问网络。

ASProxy 需要一些配置才能通过网络代理。

打开“Web.Config”文件,在“appSettings”部分找到“WebProxyMode”键。其值可能设置为以下之一:

0:表示此配置已禁用,应用程序可以直接连接到 Internet。出于安全原因,这是默认选项。
1:表示 ASProxy 可以自动检测配置。
3:表示将使用自定义值。要输入自定义值,请在“WebProxyHost”键中输入网络代理 IP,并在“WebProxyPort”键中输入其端口。

错误日志

此功能仅供开发人员使用。如果在应用程序执行过程中发生任何未处理的错误,错误详细信息将记录在一个名为“exceptions.xml”的新文件中,位于“bin”文件夹中。

要启用此功能,请打开“Web.Config”文件,在“appSettings”部分找到“ErrorLogEnabled”键并将其值更改为“true”。

ASProxyServer 配置

ASProxyServer 是 ASProxy 引入的另一种代理类型。ASProxy 的一个版本以 IP 代理的形式呈现。以下是设置和配置说明:

在 ASProxyServer 包中包含 ServerConfig.aspx。在浏览器中打开此页面(例如:proxy.mysite.com/ServerConfig.aspx)。在“Admin password”字段中输入管理密码(在“web.config”文件中的“ASProxyServerAdminPassword”键中指定)。指定您想要的端口地址,然后点击“Start proxy”按钮。代理将开始工作,状态将变为“Listening”。

要访问创建的代理,请在浏览器中遵循以下配置,但请记住 IP 地址是托管 ASProxy 的地址。(例如 mysite.com,其 IP 地址类似于 156.25.16.69)

对于“Internet Explorer”:在“控制面板”中打开“Internet 选项”。转到“连接”选项卡,然后单击“LAN 设置”按钮。在“代理服务器”组中,勾选“为 LAN 使用代理服务器”复选框,然后在“地址”字段中输入 IP 地址,在“端口”字段中输入端口号。然后点击所有 OK!

对于“FireFox”:“工具”菜单中选择“选项”,然后转到“高级”部分。转到“网络”选项卡,然后单击“连接”组上的“设置”按钮。选中“手动代理配置”单选按钮。在“HTTP 代理”字段中输入 IP 地址,在“端口”字段中输入端口号。并选中“对所有协议使用此代理服务器”复选框。然后点击所有 OK!

注意:在线时执行这些配置。这些选项在离线时可能会导致一些问题。要在“IE”中禁用它们,请取消选中“为 LAN 使用代理服务器”;在“FireFox”中,选择“直接连接到 Internet”单选按钮。

重要提示:ASProxy 的“应用程序池”应具有“System”标识才能正常工作。默认值是“Network”。您可以在 IIS 6 中访问此选项。ASProxyServer 安装程序将在安装成功后为您完成此操作。
如果您没有足够的关于 IIS 6 的信息,请不要更改配置。

工作原理

数据通常通过三种方式进行过滤:

第一种也是最简单的一种方法是通过控制传入和传出的地址。这些地址存储在一个黑名单中。当请求或响应检测到这些地址之一时,过滤软件将阻止数据传输。

第二种方法与第一种类似,但有一个包含不允许单词的列表。过滤软件会自动检测地址中的这些单词并阻止数据。

第三种方法,除了第一种和第二种方法之外,还会对接收到的数据进行搜索。搜索引擎会搜索特定的链接、地址和单词,如果这些项目的数量达到特定限制,页面将被过滤。这种过滤方式更可靠,但会降低网络速度,因此通常用于需要对用户活动进行更多控制的非公共中心。

所有这三种方法都基于一组特定的单词和地址的列表。所有绕过过滤器的工具都允许您绕过使用第一种和第二种方法工作的过滤器。请注意,第三种方法在少数情况下会被绕过。

ASProxy 的工作原理

用户必须访问安装了 ASProxy 的站点。URL 输入提供的文本框中,请求会根据网站在过滤系统中的受欢迎程度和识别度正确发送。ASProxy 引擎接收 URL 并处理请求。经过多阶段处理后,请求页面的所有地址都会被转换并发送到安装了 ASProxy 的站点。结果非常出色,因为该站点不会被识别为反过滤站点,也不会被屏蔽。以下是流程图:

背景

ASProxy 工具包含以下处理类,各自负责其解释的职责:

  • “DataManagement”部分

“DataManagement”部分包含处理 Web 原始数据的类。

  • “ASProxyEngine”类:此类的作用是接收请求,将其发送进行处理,并将结果返回给请求者。此类通过其属性和方法封装了所有必需的活动。
  • “WebDataCore”类:负责从 Web 发送和接收请求。此类执行所有必要的配置以从 Web 获取实际数据。此类是 ASProxy 的核心。
  • “CookieManager”类:在多个请求之间保存和恢复 Cookie。“WebDataCore”类始终使用此类。
  • “HttpCompressor”类:压缩页面以提高传输速度。可以通过“default”页面中的复选框启用压缩。(出于兼容性原因,默认禁用)
  • “ResumableDownload”类:将任何数据发送给用户(我们称之为“下载”)。此类实现了支持断点续传的下载。
  • “DataProcessor”部分

“DataProcessor”部分包含用于处理 HTML 页面中常用的 MIME 内容类型的类。

  • “Processors”类:此类尤其专注于编码类型转换。

此部分包含一些子部分以进行更好的分类。此部分中的类名遵循以下后缀规则:

Parser:以此后缀定义的类会查找 html 中标签的位置或更改其属性。
Processor:以此后缀定义的类会执行所有必需的操作。“ASProxyEngine”类直接使用这些类。
Replacer:以此后缀定义的类会更改或替换文本或数据(通常是 Html)的一部分。为此,这些类会使用其实现的方法。

“DataProcessor”部分的操作实现在三个子部分中。

  • HTML 类:此部分中的类执行所有必要的操作以删除或替换请求页面中的 HTML 代码。这是 ASProxy 中获取正确格式数据的最重要位置。
  • JavaScript 类:此部分中的类对 JavaScript 代码执行操作。这是 ASProxy 中最难实现的部分。
  • CSS 类:执行必要的操作以替换 CSS 文件中的地址。此部分的主要目标是替换“background”属性。
  • “Configurations”部分

此部分包含保存或恢复已保存数据的类。

  • “ASProxyConfig”类:在请求之间保存和恢复 ASProxy 设置。默认设置从“Web.config”检索,用户更改从 Cookie 检索。
  • “SiteExceptions”类:存储未处理的错误列表以供将来调试。错误日志记录默认情况下是关闭的,可以在“Web.config”文件中更改。
  • “General”部分

包含通用且有用的类。

  • “Performance”类:包含一些用于简单 dotNET Framework 字符串函数的替换函数,这些函数可显著提高 ASProxy 引擎的速度。
  • “UrlProvider”和“UrlBuilder”类:包含一些用于处理 URL 的函数。
  • “HtmlTags”类:包含一些用于处理 HTML 的函数。
  • “ASProxyFunctions”类:包含 ASProxy 中使用的一些通用实用函数。

追踪 后台工作(面向开发人员)

在这里,我们概述 ASProxy 的工作步骤。

下面我们请求访问一个站点(例如 www.softprojects.org),因此预期响应数据类型应为 HTML。

深度
1
2
3
3
3.1
3.2
3.3
3
-
4
4
4.1
4.2
4.2
4.2.1
4.2.2
4.2.3
4.2.4
4.2
-
4.3
4.3
4.3.1
4.3.1
4.3.1.1
4.3.1.2
4.3.1.3
4.3.1
4.3
4.4
4
5
执行跟踪
Request a site:
Initialize an ASProxyEngine
Test content type by PreExecute
{
    IMAGE: Link to images.aspx page and display it in page as img tag. END.
    Unknown: Redirect to download page. END.
    HTML: Continue!
}

in ASProxyEngine
{
    Initialize a WebDataCore
    Execute the request by WebDataCore instance
    {
        Initialize &quot;PostBack&quot; or &quot;Get&quot; methods information.
        Add cookies.
        Get the response.
        Restore returned cookies and save them.
    }
    
    if html process requested
    {
        Test content mime type
        {
            HTML: Initialize HtmlProcessor and process data.
            JavaScript:  Initialize JSProcessor and process data.
            CSS:  Initialize CSSProcessor and process data.
        }
    }
    return processed data.
}
Display response in a label!

主要功能概述

为了让用户请求 URL,首先需要创建一个主类实例来处理请求(gethtml.aspx)。

    engine = new ASProxyEngine(ProcessTypeForData.HTML,true);
    engine.RequestInfo.ContentType = MimeContentType.text_html;
    engine.Initialize(Request);
    engine.Execute(Response);

在此代码中,我们指定数据类型为 HTML。然后调用 ASProxyEngine 的“initialize”方法来指定请求信息,例如请求 URL。

最后,我们调用“Execute”方法来确认操作。此方法会将结果直接应用于响应。

如何在新页面中实现此操作

为此,请向 ASProxy 项目添加一个新页面,并添加一个文本框、一个按钮和一个标签。为了节省资源,请将 Label 的“EnableViewState”属性设置为 false;我们不需要它的状态。然后在按钮单击事件中编写这些代码:

protected void Button1_Click(object sender, EventArgs e)
{
  SalarSoft.ASProxy.ASProxyEngine engine = 
    new SalarSoft.ASProxy.ASProxyEngine(SalarSoft.ASProxy.ProcessTypeForData.HTML);
  engine.RequestInfo.ContentType = SalarSoft.ASProxy.MimeContentType.text_html;
  engine.Initialize(TextBox1.Text);

  string myResponse;
  engine.Execute(out myResponse);
  Label1.Text = myResponse;
}

运行新页面,输入一个 URL,然后单击按钮;URL 将会显示。

该页面上没有任何内容会正常工作。它只是 HTML 代码,本身没有用。因此,为了获得更好的结果,我们更改代码。

protected void Button1_Click(object sender, EventArgs e)
{
  SalarSoft.ASProxy.ASProxyEngine engine =
    new SalarSoft.ASProxy.ASProxyEngine(SalarSoft.ASProxy.ProcessTypeForData.HTML, true);
  engine.RequestInfo.ContentType = SalarSoft.ASProxy.MimeContentType.text_html;
  engine.Initialize(TextBox1.Text);

  string myResponse;
  engine.Execute(out myResponse);
  Label1.Text = myResponse;
}

在 ASProxyEngine 的构造函数中添加了一个“true”。此“true”指定选项应自动从 Cookie 或默认选项中恢复。

如果您想要更多地控制设置,可以手动设置。为此需要 OptionsType 类。如果您想访问存储的设置,应该使用 ASProxyConfig 类。

看看这个例子:

protected void Button1_Click(object sender, EventArgs e)
{

  SalarSoft.ASProxy.ASProxyEngine engine =
    new SalarSoft.ASProxy.ASProxyEngine(SalarSoft.ASProxy.ProcessTypeForData.HTML, false);
  engine.RequestInfo.ContentType = SalarSoft.ASProxy.MimeContentType.text_html;

  SalarSoft.ASProxy.OptionsType opt = SalarSoft.ASProxy.ASProxyConfig.GetCookieOptions();
  opt.Images = false;
  opt.AcceptCookies = false;
  engine.Options = opt;

  engine.Initialize(TextBox1.Text);

  string myResponse;
  engine.Execute(out myResponse);
  Label1.Text = myResponse;
}

在此示例中,选项通过“GetCookieOptions”方法恢复,然后禁用 Images 和 AcceptCookies。

现在一切看起来都正常,但链接不起作用。当前页面应检测查询中的 URL 并显示它们。为此,我们必须在 Page_Load 事件中编写相同的代码:

protected void Page_Load(object sender, EventArgs e)
{
  SalarSoft.ASProxy.FilesConsts.DefaultPage =
    System.IO.Path.GetFileName(Request.Url.AbsolutePath).ToLower();
  bool isClicked=(Request.Form<button1.id>!=null);

  if(isClicked==false && SalarSoft.ASProxy.UrlProvider.IsASProxyAddressUrlIncluded(Request.QueryString))
  {
    SalarSoft.ASProxy.ASProxyEngine engine =
        new SalarSoft.ASProxy.ASProxyEngine(SalarSoft.ASProxy.ProcessTypeForData.HTML,false);
    engine.RequestInfo.ContentType = SalarSoft.ASProxy.MimeContentType.text_html;
    SalarSoft.ASProxy.OptionsType opt = SalarSoft.ASProxy.ASProxyConfig.GetCookieOptions();
    opt.Images = false;
    opt.AcceptCookies = false;
    engine.Options = opt;
    engine.Initialize(TextBox1.Text);
    
    string myResponse;
    engine.Execute(out myResponse);
    Label1.Text = myResponse;
  }
}</button1.id>

在此代码中,我们设置了“DefaultPage”值,它指定了代理的默认页面,如果更改了它,所有链接的目标都会更改。因此,在使用此属性时要小心;它可能会引起歧义。

此代码中使用的另一个重要方法是“IsASProxyAddressUrlIncluded”。此方法检查当前查询是否包含 URL。

此代码的重要之处在于检测回发(post back)的类型。代码必须检测回发是通过按 button1 完成的还是通过其他方式完成的。此检测结果设置为“isClicked”变量。在“Page_Load”事件中,当 button1 未被按下且查询包含 URL 地址或回发是通过提交表单发生的时,操作不会运行。

实现

下面您将看到一些重要的实现方法。

这里是“Initialize”方法的实现,它有 2 个重载。您将看到重要的相关方法,如“InitializeRequestQueriesByHttpRequest”和“DoAutoDetection”。

/// <summary>
/// Initialize ASProxy engine with as HttpRequest
/// </summary>
/// <param name=&quot;httpRequest&quot;>HttpRequest instance</param>
public void Initialize(HttpRequest httpRequest)
{
  InitializeRequestQueriesByHttpRequest(httpRequest);
  DoAutoDetection(httpRequest);
}

/// <summary>
/// Initialize ASProxy engine with specified url address
/// </summary>
/// <param name=&quot;requestUrl&quot;>Requested url address</param>
public void Initialize(string requestUrl)
{
  RequestInfo.RequestUrl = requestUrl;
  RequestInfo.RequestedQueries = requestUrl;
  DoAutoDetection(null);
}

private void DoAutoDetection(HttpRequest httpRequest)
{
    if (httpRequest != null)
    {
        RequestInfo.RequestedQueries = GetQueryCollectionString(httpRequest.QueryString);

    // When a post back event occurred &quot;httpRequest.ContentType&quot; contains ContentType of request
    // In other cases the &quot;httpRequest.ContentType&quot; is empty and we shouldn't use this property
    if(!string.IsNullOrEmpty(httpRequest.ContentType))
      RequestInfo.ContentTypeString = httpRequest.ContentType;// Added again in version 3.7
        RequestInfo.InputStream = httpRequest.InputStream;
    }

    // Get posted form data string
    if (RequestInfo.HttpRequestMethod == WebRequestMethod.POST)
    {
        if (httpRequest != null)
        {
            RequestInfo.PostedFormData = httpRequest.Form.ToString();

            // Some web sites encodes the url, and we need to decode it to be useful
            //RequestInfo.PostedFormData = HttpUtility.UrlDecode(RequestInfo.PostedFormData);
            RequestInfo.PostedFormData = HttpUtility.HtmlDecode(RequestInfo.PostedFormData);
        }
    }
    else
        RequestInfo.PostedFormData = &quot;&quot;;


    if(RequestInfo.RequestInQueryMethod== WebRequestMethod.GET)
    {
        // Apply filter for ASP.NET pages
        RequestInfo.PostedFormData = RequestInfo.PostedFormData;

        if (fAutoDetection)
        {
            // Change requested url by posted data
            RequestInfo.RequestUrl =
                UrlBuilder.AppendAntoherQueries(RequestInfo.RequestUrl,
                    RequestInfo.PostedFormData);
        }
    }
}

/// <summary>
/// Auto detect the request information from HttpRequest
/// </summary>
/// <param name=&quot;httpRequest&quot;>HttpRequest instance</param>
private void InitializeRequestQueriesByHttpRequest(HttpRequest httpRequest)
{
  if (fAutoDetection)
  {

    // Get http request method
    RequestInfo.HttpRequestMethod = ASProxyFunctions.StringToRequestMethod(httpRequest.HttpMethod);


    bool tmpBool = false;

    // Get requested url
    string url = httpRequest.QueryString[Consts.qUrlAddress];
    if (!string.IsNullOrEmpty(url))
    {
      string decode = httpRequest.QueryString[Consts.qDecode];
      if (decode != null)
      {
        try
        {
          tmpBool = Convert.ToBoolean(Convert.ToInt32(decode));
        }
        catch
        {
          tmpBool = false;
        }
      }

      // If url is encoded, decode it
      if (tmpBool)
      {
        url = UrlProvider.DecodeUrl(url);
      }
      RequestInfo.RequestUrl = url;
    }

    tmpBool = false;

    // Get request post method state
    string postForm = httpRequest.QueryString[Consts.qIsPostForm];
    if (postForm != null && postForm != &quot;&quot;)
    {
      try
      {
        tmpBool = Convert.ToBoolean(Convert.ToInt32(postForm));
      }
      catch
      {
        tmpBool = false;
      }
    }

    // if request is post method set the options
    if (tmpBool)
      RequestInfo.RequestInQueryMethod = WebRequestMethod.POST;
    else
      RequestInfo.RequestInQueryMethod = WebRequestMethod.GET;
  }
}

这里是“PreExecution”方法的实现。此方法将执行请求但不会返回任何结果。这对于检查响应头并决定是继续执行“Execute”方法还是不执行很有用。

请注意,在调用“PreExecution”方法之后,我们可以调用“Execute”方法,或者我们可以直接调用“Execute”方法而不调用“PreExecute”方法。

/// <summary>
/// Executes the request and gets the responses but don&#39;t process the results
/// </summary>
public void PreExecution()
{
  if (fAutoDetection)
  {
    // If this is an image request, we should provide orginal link as referer
    if (RequestInfo.ContentType == MimeContentType.image_gif 
        || RequestInfo.ContentType == MimeContentType.image_jpeg)
      this.fUseRequestUrlAsReferer = true;
  }

  // Data executin should be one time!
  if (fWebData == null)
  {
    do
    {
      // If this is auto recection request send request again to new location
      if (fWebData != null && fWebData.ResponseInfo.AutoRedirect)
      {
        Uri autoRedirectLocation = fWebData.ResponseInfo.AutoRedirectLocation;

        CookieCollection cookies = fWebData.ResponseInfo.Cookies;
        bool redirectIsInternal = fWebData.ResponseInfo.AutoRedirectIsInternal;
        RequestInfo.RequestUrl = autoRedirectLocation.ToString();

        fWebData.Dispose();
        fWebData = null;
        fWebData = new WebDataCore(RequestInfo.RequestUrl);

        // In auto redirection it previous writed cookies needed and we set it here!
        if (redirectIsInternal)
        {
          fWebData.RequestInfo.Cookies = cookies;
        }
      }
      else
        fWebData = new WebDataCore(RequestInfo.RequestUrl);

      fWebData.UseRequestUrlAsReferer = fUseRequestUrlAsReferer;
      fWebData.RequestInfo.RequestMethod = RequestInfo.RequestInQueryMethod;
      fWebData.RequestInfo.PostDataString = RequestInfo.PostedFormData;
      fWebData.RequestInfo.ContentType = RequestInfo.ContentTypeString;
      fWebData.RequestInfo.InputStream = RequestInfo.InputStream;
      fWebData.AcceptCookies = fOptions.AcceptCookies;
      fWebData.DisplayErrorPageAsResult = false;

      // Run the request
      fWebData.Execute();

      // If execution returned an error
      if (fWebData.Status == LastActivityStatus.Error)
      {
        this.fLastErrorMessage = fWebData.ErrorMessage;
        this.fLastStatus = LastActivityStatus.Error;
        this.fLastException = fWebData.LastException;
        return;
      }

    } while (fWebData.ResponseInfo.AutoRedirect);

    SetResponseInformation();
  }
}

请注意,循环用于执行请求以实现重定向行为。

版本历史

当前版本:5.5 beta4

版本 4.5 2008/08/09
* Cookie 管理已改进。Cookie 将根据站点指定的域名保存。
此功能能够绕过大多数站点的登录过程。

版本 4.4 2008/08/08
* 添加了一些响应头以支持某些功能。
例如 Cache-Control 允许缓存图像和静态内容。
此功能提高了页面加载速度并降低了服务器压力。

版本 4.3 2008/06/13
* 修复:仅包含参数的查询问题已修复。(例如 <a href="?pass=yes">Testing</a>)
* ASProxyEncoder(动态内容编码器,“asproxyencoder.js”文件)的 URL 编码函数已改进。
* 修复:POST Cookie 问题已解决。此问题导致无法绕过登录页面。
* 修复:ASProxy 现在可以在子目录中正常工作。
* 修复:BASE 标签行为已改进。
* 修复:“asproxyencoder.js”中“CorrectLocalUrlToOrginal”函数中的一些错误已修复。
* 修复:下载文件名中的空格字符问题已通过将空格替换为破折号来解决。
* 下载工具正确显示错误消息和错误 URL。

版本 4.2 2008/03/27
* ASProxy for mono 发布。
* 支持带有“data:”前缀的嵌入式数据。
* 增强了显示链接和图像的原始地址。

版本 4.1 2008/03/08
* 支持 Basic、Digest 和 Integrated Windows 身份验证。
* 增强了显示链接和图像的原始地址。
* 某些选项已重命名。“Display orginal url”重命名为“Original URLs”,“Always use UTF-8”重命名为“Force UTF-8”。
* UI 已改进。

版本 4.0 2007/12/29
* 自动更新可用!此功能默认禁用,可以通过在 Web.Config 文件中设置 ASProxyAutoUpdateEnabled 键来启用。
* 私有代理的用户名和密码保护现已可用!只需在 Web.Config 文件中更改设置(键名为:ASProxyLoginNeeded、ASProxyLoginUser 和 ASProxyLoginPassword)。
* 登录表单中的大多数问题已修复。此问题是由于“default.aspx”页面中的自回发(self post back)处理问题。
* 修复了一些 ASProxyServer 的 Bug。
* Cookie 处理机制已改进。现在 Cookie 会正确存储。
* 支持 style 标签中的内联背景样式。例如:<style>backgound-image:url(image.jpg);</style>
* 修复了一些用户代理(user agent)的 Bug。

特别感谢Ali Mohammadzadeh协助英文翻译。

© . All rights reserved.