5,928
社区成员




TTestThread = class(TThread)
public
httpMain: TIdHTTP;
sslMain: TIdSSLIOHandlerSocketOpenSSL;
constructor Create; overload;
destructor Destroy; override;
procedure Execute; override;
end;
constructor TTestThread.Create;
begin
inherited Create(False);
httpMain := TIdHTTP.Create(nil);
sslMain := TIdSSLIOHandlerSocketOpenSSL.Create(nil);
sslMain.SSLOptions.Method := sslvSSLv3;
sslMain.SSLOptions.Mode := sslmUnassigned;
httpMain.AllowCookies := True;
httpMain.HandleRedirects := True;
httpMain.HTTPOptions := [hoKeepOrigProtocol, hoForceEncodeParams];
httpMain.ReadTimeout := 20000;
httpMain.ConnectTimeout := 10000;
end;
destructor TTestThread.Destroy;
begin
httpMain.Free;
sslMain.Free;
inherited Destroy;
end;
procedure TTestThread.Execute;
begin
while not Terminated do begin
httpMain.IOHandler := sslMain;
httpMain.Request.UserAgent := 'Mozilla/3.0 (compatible)';
httpMain.Get('https://mail.qq.com/cgi-bin/loginpage?');
end;
Destroy;
end;