Jump to content
YOUR-AD-HERE
HOSTING
TOOLS
992Proxy

Locked ProxyChecker


sQuo

Recommended Posts

This is the hidden content, please

 

[LENGUAJE=delphi]uses

Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,

Dialogs, StdCtrls, XPMan, ExtCtrls, ComCtrls, IdHTTP, IdSSL, IdSSLOpenSSL, IdSocks;

 

type

TfrmTDPC = class(TForm)

XPManifest: TXPManifest;

txtSrcList: TMemo;

txtChkList: TMemo;

lblSrcCount: TStaticText;

lblVldCount: TStaticText;

grpControl: TGroupBox;

txtThreads: TLabeledEdit;

udThreads: TUpDown;

udTimeout: TUpDown;

txtTimeout: TLabeledEdit;

btnStop: TButton;

btnStart: TButton;

rbtSOCKS5: TRadioButton;

rbtSOCKS4: TRadioButton;

rbtHTTP: TRadioButton;

pgbStatus: TProgressBar;

lblThreads: TStaticText;

procedure btnStartClick(Sender: TObject);

procedure txtSrcListChange(Sender: TObject);

procedure FormCreate(Sender: TObject);

procedure rbtHTTPClick(Sender: TObject);

procedure rbtSOCKS4Click(Sender: TObject);

procedure rbtSOCKS5Click(Sender: TObject);

procedure txtThreadsChange(Sender: TObject);

procedure txtTimeoutChange(Sender: TObject);

procedure btnStopClick(Sender: TObject);

procedure txtChkListChange(Sender: TObject);

private

{ Private declarations }

public

procedure ViewThreads;

procedure Start;

procedure Stop;

end;

 

type TProxyType = (ptHTTP, ptSOCKS4, ptSOCKS5);

 

type

TMultiThread = class(TThread)

private

HTTP: TIdHTTP;

SSL: TIdSSLIOHandlerSocketOpenSSL;

SOCKS: TIdSocksInfo;

Server: string;

Port: integer;

procedure ReadProxy;

procedure ReadTimeout;

procedure ExitThread;

procedure AddProxy;

procedure CheckProxy;

protected

procedure Execute; override;

end;

 

var

frmTDPC: TfrmTDPC;

Thread: array of TMultiThread;

ThreadCount: integer;

ThreadExit: boolean;

ProxyIndex: integer;

ProxyType: TProxyType;

 

implementation

 

{$R *.dfm}

 

{ TMultiThread }

 

procedure TMultiThread.AddProxy;

begin

 

frmTDPC.txtChkList.Lines.Add(Server + ':' + IntToStr(Port))

end;

 

procedure TMultiThread.CheckProxy;

begin

frmTDPC.pgbStatus.StepIt;

frmTDPC.Caption := 'TDPC [' + IntToStr(ProxyIndex) + '/' + IntToStr(frmTDPC.txtSrcList.Lines.Count) + ']';

end;

 

procedure TMultiThread.Execute;

begin

inherited;

HTTP := TIdHTTP.Create(nil);

HTTP.Request.UserAgent := 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/534.13 (KHTML, like Gecko) Chrome/9.0.597.98 Safari/534.13';

SSL := TIdSSLIOHandlerSocketOpenSSL.Create(nil);

SOCKS := TIdSocksInfo.Create(nil);

Synchronize(ReadTimeout);

while (true) do

begin

Synchronize(ReadProxy);

if ThreadExit then break;

try

if Pos('www.artlebedev.ru', HTTP.Get('http://ya.ru')) > 0 then

Synchronize(AddProxy);

except

end;

Synchronize(CheckProxy);

end;

Synchronize(ExitThread);

SOCKS.Free;

SSL.Free;

HTTP.Free;

end;

 

procedure TfrmTDPC.btnStartClick(Sender: TObject);

var

Index: integer;

begin

ProxyIndex := 0;

ThreadCount := 0;

frmTDPC.Caption := 'TDPC [' + IntToStr(ProxyIndex) + '/' + IntToStr(frmTDPC.txtSrcList.Lines.Count) + ']';

frmTDPC.Start;

ThreadExit := False;

SetLength(Thread, udThreads.Position);

for Index := 0 to udThreads.Position - 1 do

begin

Thread[index] := TMultiThread.Create(true);

Thread[index].FreeOnTerminate := True;

Thread[index].Resume;

end;

end;

 

procedure TfrmTDPC.btnStopClick(Sender: TObject);

begin

ThreadExit := True;

end;

 

procedure TfrmTDPC.FormCreate(Sender: TObject);

begin

txtSrcList.Lines.NameValueSeparator := ':';

rbtHTTPClick(Self);

end;

 

procedure TfrmTDPC.rbtHTTPClick(Sender: TObject);

begin

if rbtHTTP.Checked then

ProxyType := ptHTTP;

end;

 

procedure TfrmTDPC.rbtSOCKS4Click(Sender: TObject);

begin

if rbtSOCKS4.Checked then

ProxyType := ptSOCKS4;

end;

 

procedure TfrmTDPC.rbtSOCKS5Click(Sender: TObject);

begin

if rbtSOCKS5.Checked then

ProxyType := ptSOCKS5;

end;

 

procedure TfrmTDPC.Start;

begin

txtSrcList.Enabled := False;

txtThreads.Enabled := False;

udThreads.Enabled := False;

txtTimeout.Enabled := False;

udTimeout.Enabled := False;

rbtHTTP.Enabled := False;

rbtSOCKS4.Enabled := False;

rbtSOCKS5.Enabled := False;

btnStart.Enabled := False;

btnStop.Enabled := True;

txtChkList.Clear;

txtChkListChange(Self);

pgbStatus.Max := txtSrcList.Lines.Count;

pgbStatus.Position := 0;

end;

 

procedure TfrmTDPC.Stop;

begin

txtSrcList.Enabled := True;

txtThreads.Enabled := True;

udThreads.Enabled := True;

txtTimeout.Enabled := True;

udTimeout.Enabled := True;

rbtHTTP.Enabled := True;

rbtSOCKS4.Enabled := True;

rbtSOCKS5.Enabled := True;

btnStart.Enabled := True;

btnStop.Enabled := False;

pgbStatus.Position := 0;

end;

 

procedure TfrmTDPC.txtChkListChange(Sender: TObject);

begin

lblVldCount.Caption := '????????: ' + IntToStr(txtChkList.Lines.Count);

end;

 

procedure TfrmTDPC.txtSrcListChange(Sender: TObject);

begin

lblSrcCount.Caption := '?????????: ' + IntToStr(txtSrcList.Lines.Count);

end;

 

procedure TfrmTDPC.txtThreadsChange(Sender: TObject);

var

iThreads: integer;

begin

try

iThreads := StrToInt(txtThreads.Text);

if (iThreads udThreads.Max) then

txtThreads.Text := IntToStr(udThreads.Position);

except

txtThreads.Text := IntToStr(udThreads.Position);

end;

end;

 

procedure TfrmTDPC.txtTimeoutChange(Sender: TObject);

var

iTimeout: integer;

begin

try

iTimeout := StrToInt(txtTimeout.Text);

if (iTimeout udTimeout.Max) then

txtTimeout.Text := IntToStr(udTimeout.Position);

except

txtTimeout.Text := IntToStr(udTimeout.Position);

end;

end;

 

procedure TfrmTDPC.ViewThreads;

begin

lblThreads.Caption := '???????: ' + IntToStr(ThreadCount);

end;

 

procedure TMultiThread.ReadProxy;

begin

if ProxyIndex >= frmTDPC.txtSrcList.Lines.Count then

ThreadExit := True

else

begin

try

Server := Trim(frmTDPC.txtSrcList.Lines.Names[ProxyIndex]);

Port := StrToInt(Trim(frmTDPC.txtSrcList.Lines.ValueFromIndex[ProxyIndex]));

except

Server := '0.0.0.0';

Port := 80;

end;

case ProxyType of

ptHTTP:

begin

HTTP.ProxyParams.ProxyServer := Server;

HTTP.ProxyParams.ProxyPort := Port;

end;

ptSOCKS4:

begin

SOCKS.Authentication := saNoAuthentication;

SOCKS.Version := svSocks4;

SOCKS.Host := Server;

SOCKS.Port := Port;

SSL.TransparentProxy := SOCKS;

HTTP.IOHandler := SSL;

end;

ptSOCKS5:

begin

SOCKS.Authentication := saNoAuthentication;

SOCKS.Version := svSocks5;

SOCKS.Host := Server;

SOCKS.Port := Port;

SSL.TransparentProxy := SOCKS;

HTTP.IOHandler := SSL;

end;

end;

Inc(ProxyIndex);

end;

end;

 

procedure TMultiThread.ReadTimeout;

begin

HTTP.ConnectTimeout := frmTDPC.udTimeout.Position * 1000;

HTTP.ReadTimeout := frmTDPC.udTimeout.Position * 1000;

Inc(ThreadCount);

frmTDPC.ViewThreads;

end;

 

procedure TMultiThread.ExitThread;

begin

Dec(ThreadCount);

if ThreadCount

begin

frmTDPC.Stop;

frmTDPC.Caption := 'TDPC';

end;

frmTDPC.ViewThreads;

end;

 

end.[/LENGUAJE]

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.