设置了ProxyServer及ProxyPort属性但是访问一个网页时显示的IP仍然是我自己本机的IP,而不是设置的代理IP怎么回事?

解决方案 »

  1.   

    你参考一下下面的代码
    procedure InitHttp();
    begin
        http := TIdHTTP.Create(nil);
        http.ReadTimeout := 30000;
        http.OnRedirect := OnRedirect;
        http.Request.Accept := 'image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-                           shockwave-flash, */*';
        http.Request.AcceptLanguage := 'zh-cn';
        http.Request.ContentType := 'application/x-www-form-urlencoded';
        http.Request.UserAgent := 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1;Maxthon;.NET CLR 1.1.4322)';
        http.ProxyParams.ProxyServer := '代理服务器地址';
        http.ProxyParams.ProxyPort := '代理服务器端口';
    end;
      

  2.   

    有效的,你是访问哪个网页显示IP的。ip138.com这些网站显ip,它是可以判断你访问过来的来路是不是用了代理了,如果是用了代理,它也会只显示你的真实IP。如果你想在这样的网站访问显示你的代理iP,你应该用高匿名代理,这样的显IP网站才判断不出你是不是用了代理。
    你可以自己做一个简单的显示客户IP的网页自己访问下就知道了
      

  3.   

    我也试过了,真的没有作用,直接idhttp.get('url');都能取出数据.