文章详情
接入指南 - 代码 - Delphi
interface

uses
    Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
    Dialogs, StdCtrls, IDHTTP;

type
    TForm1 = class(TForm)
        Button1: TButton;
        procedure Button1Click(Sender: TObject);
    private
        { Private declarations }
    public
        { Public declarations }
    end;

var
    Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
const
    // 要访问的目标页面
    targetUrl  = 'http://www.quqiquqi.com/test';
    // 请求切换IP(仅短效版、长效版用。动态版每次请求自动切换,无需指定)
    //targetUrl  = 'http://www.quqiquqi.com/switch-ip';
    // 查看当前隧道出口IP信息
    //targetUrl = 'http://www.quqiquqi.com/current-ip';

    // 代理服务器
    proxyServer = 'tunnel.quqiquqi.com';
    proxyPort = 8600;

    // 代理隧道验证信息
    proxyUser = 'U123456789';
    proxyPass = 'P123456789';
var
    IDHTTP1 : TIDHTTP;
begin
    Application.ProcessMessages;
    IDHTTP1 := TIDHTTP.Create(nil);
    with IDHTTP1 do
    begin
        AllowCookies := True;
        HandleRedirects := True;
        ProxyParams.BasicAuthentication := True;
        ProxyParams.ProxyServer := proxyServer;
        ProxyParams.ProxyPort := proxyPort;
        ProxyParams.ProxyUsername := proxyUser;
        ProxyParams.ProxyPassword := proxyPass;
        //Request.Method := 'GET';
        //Request.Accept := 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8';
        //Request.AcceptEncoding := 'gzip, deflate, sdch';
        //Request.AcceptLanguage := 'zh-CN,zh;q=0.8';
        //Request.Connection := 'keep-alive';
        Request.UserAgent := 'Mozilla/5.0 (Windows NT 6.0) AppleWebKit/537.36 (KHTML, like Gecko)';
        IDHTTP1.Get(targetUrl);
    end;
end;

end.                
发布时间:2021-10-02

在线客服