procedure TWebServer.HTTPServerCommandGet(AThread: TIdPeerThread;
  ARequestInfo: TIdHTTPRequestInfo; AResponseInfo: TIdHTTPResponseInfo);
var
  UrlPar:Tstrings;
  aaa:string;
begin
    //EnterCriticalSection(MyCs); //进入临界区
  try
  AThread.FreeOnTerminate:=True;
  UrlPar := TStringList.Create; //提交的参数 0 : host 1 : geturl 2 : refurl
  UrlPar.CommaText := ARequestInfo.QueryParams;
  if UrlPar.Count = 3 then
  begin
    JS:= Tidhttp.Create(nil);
    JS.Disconnect;
    JS.Free;
    JS:= Tidhttp.Create(nil);
    JS.ReadTimeout:=9000;
    JS.ConnectTimeout:=9000;
    JS.HandleRedirects:=True;
    JS.AllowCookies:=True;
    JS.Request.Accept:='application/x-shockwave-flash, image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*';
    JS.Request.UserAgent:='Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; SV1; .NET CLR 2.0.50727)';
    JS.Request.Connection:='Keep-Alive';
    JS.Request.AcceptEncoding:='gzip';
    if UrlPar[2]<>'' then JS.Request.Referer:='http://'+UrlPar[0]+UrlPar[2];
    aaa:=JS.Get('http://'+UrlPar[0]+UrlPar[1]);
    if JS.Response.ContentEncoding='gzip' then AResponseInfo.ContentText:=ZLibExGZ.GZDecompressStr(aaa)
    else  AResponseInfo.ContentText:=aaa;
    AResponseInfo.ContentText='OKOKOK';//加上这句后就不会有那些问题了,为什么???
    //JS.Disconnect;
    //JS.Free;
  end;
    finally
    JS.Disconnect
    //JS.Free;    //if AThread.Suspended=True then AThread.Resume;
//AThread.Terminate;
//LeaveCriticalSection(MyCs); //离开临界区  end;//AThread.Free;
end;