I've been working on this for a few days and have read a lot of the details on the site here, but have yet to get this working. 

I am looking to have OpenLayers running on our internal Intranet. I have OpenLayers up on IIS7, and have come to understand that I need to get a proxy file configured to serve both KML layers hosted locally, and calls to base maps that are web based.

If all these assumptions have been right thus far, I just have a question about getting the proxy to work.

1) First question, do I need to change any of the code in this file? I still don't understand how referencing this file as is connects to my local OL directory

```
using System;
using System.Configuration;
using System.Diagnostics;
using System.IO;
using System.Net;
using System.Text;
using System.Web;

/// <summary>
/// adapted from: http://code.google.com/p/iisproxy
/// </summary>
public class host : IHttpHandler
{
public void ProcessRequest(HttpContext context)
{
    Stopwatch watch = new Stopwatch();
    watch.Start();

    try
    {
        string uri = context.Request.QueryString["url"];
        if (String.IsNullOrEmpty(uri))
            throw new ArgumentException("url parameter null");

        StringBuilder sb = new StringBuilder();
        foreach (string s in context.Request.QueryString)
            if (!String.Equals(s, "url"))
                sb.AppendFormat("&{0}={1}", s, context.Request.QueryString[s]);
        if (sb.Length > 0)
            uri += String.Format("?{0}", sb.Remove(0, 1));

        HttpWebRequest req = (HttpWebRequest)WebRequest.Create(uri);
        req.AllowAutoRedirect = false;
        req.Method = context.Request.HttpMethod;
        req.ContentType = context.Request.ContentType;
        req.UserAgent = context.Request.UserAgent;

        string basicPwd = ConfigurationManager.AppSettings.Get("basicPwd");
        req.Credentials = basicPwd == null ? CredentialCache.DefaultCredentials : new NetworkCredential(context.User.Identity.Name, basicPwd);
        req.PreAuthenticate = true;
        req.Headers["Remote-User"] = context.User.Identity.Name;

        foreach (string s in context.Request.Headers)
            if (!WebHeaderCollection.IsRestricted(s) && !String.Equals(s, "Remote-User"))
                req.Headers.Add(s, context.Request.Headers[s]);

        if (context.Request.HttpMethod == "POST")
        {
            Stream outputStream = req.GetRequestStream();
            CopyStream(context.Request.InputStream, outputStream);
            outputStream.Close();
        }

        HttpWebResponse response;
        try
        {
            response = (HttpWebResponse)req.GetResponse();
        }
        catch (WebException we)
        {
            response = (HttpWebResponse)we.Response;
            if (response == null)
            {
                context.Response.StatusCode = 13;
                context.Response.Write("Could not contact back-end site");
                context.Response.End();
                return;
            }
        }

        context.Response.StatusCode = (int)response.StatusCode;
        context.Response.StatusDescription = response.StatusDescription;
        context.Response.ContentType = response.ContentType;
        if (response.Headers.Get("Location") != null)
        {
            string urlSuffix = response.Headers.Get("Location");
            if (urlSuffix.ToLower().StartsWith(ConfigurationManager.AppSettings["ProxyUrl"].ToLower()))
                urlSuffix = urlSuffix.Substring(ConfigurationManager.AppSettings["ProxyUrl"].Length);
            context.Response.AddHeader("Location", context.Request.Url.GetLeftPart(UriPartial.Authority) + urlSuffix);
        }

        foreach (string s in response.Headers)
            if (!WebHeaderCollection.IsRestricted(s) && !String.Equals(s, "Location"))
                context.Response.AddHeader(s, response.Headers[s]);

        CopyStream(response.GetResponseStream(), context.Response.OutputStream);
        response.Close();
        context.Response.End();
    }
    catch (Exception ex)
    {
        Trace.WriteLine("proxy error: " + ex);
        throw;
    }
    finally
    {
        watch.Stop();
        string message = String.Format("request sent in {0} milliseconds", watch.ElapsedMilliseconds);
        Debug.WriteLine(message);
    }
}

static void CopyStream(Stream input, Stream output)
{
    byte[] buffer = new byte[1024];
    int bytes;
    while ((bytes = input.Read(buffer, 0, 1024)) > 0)
        output.Write(buffer, 0, bytes);
}

public bool IsReusable
{
    get { return false; }
}

```

}

2) Second. When I go to the local proxy address, I am getting this error: Server Error in '/' Application.

Any help is much appreciated.