Delpi As2
Delpi As2
Delpi As2
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, IdBaseComponent, IdComponent, IdTCPServer,
IdMappedPortTCP, XPMan, sSkinProvider, sSkinManager, ExtCtrls, sLabel,
ComCtrls, sStatusBar, sGroupBox, sCheckBox, ShellApi, IdIPWatch;
type
TAce = class(TForm)
IdMappedPortTCP1: TIdMappedPortTCP;
Button1: TButton;
Button2: TButton;
GroupBox1: TGroupBox;
EditHost: TEdit;
Button3: TButton;
Label1: TLabel;
sSkinManager1: TsSkinManager;
sSkinProvider1: TsSkinProvider;
XPManifest1: TXPManifest;
sLabelFX1: TsLabelFX;
sLabelFX2: TsLabelFX;
sLabelFX3: TsLabelFX;
sGroupBox1: TsGroupBox;
sGroupBox2: TsGroupBox;
sGroupBox3: TsGroupBox;
sStatusBar1: TsStatusBar;
ip: TsLabel;
Timer2: TTimer;
IdIPWatch1: TIdIPWatch;
procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure IdMappedPortTCP1OutboundData(AThread: TIdMappedPortThread);
procedure Timer2Timer(Sender: TObject);
procedure sLabelFX2Click(Sender: TObject);
procedure sLabelFX1Click(Sender: TObject);
procedure sLabelFX3Click(Sender: TObject);
procedure IdMappedPortTCP1Execute(AThread: TIdMappedPortThread);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Ace: TAce;
implementation
{$R *.dfm}
function AddHeader(header, Newheader:string):string;
begin
header := StringReplace(header, #13#10 + #13#10, #13#10 + Newheader + #13#10 + #
13#10, [rfReplaceAll]);
Result := header;
end;
,[rfReplaceAll]);
end else
if Pos ('HTTP/1.0 504 Gateway Time-out', AThread.NetData) <> 0 then begin
AThread.NetData := StringReplace(athread.NetData,'504 Gateway Time-out','200 OK'
,[rfReplaceAll]);
end else
if Pos ('504 Gateway Time-out', AThread.NetData) <> 0 then begin
AThread.NetData := StringReplace(athread.NetData,'504 Gateway Time-out','200 OK'
,[rfReplaceAll]);
end else
if Pos ('HTTP/1.1 503 Service Unavailable', AThread.NetData) <> 0 then begin
AThread.NetData := StringReplace(athread.NetData,'503 Service Unavailable','200
OK',[rfReplaceAll]);
end else
if Pos ('HTTP/1.0 503 Service Unavailable', AThread.NetData) <> 0 then begin
AThread.NetData := StringReplace(athread.NetData,'503 Service Unavailable','200
OK',[rfReplaceAll]);
end else
if Pos ('503 Service Unavailable', AThread.NetData) <> 0 then begin
AThread.NetData := StringReplace(athread.NetData,'503 Service Unavailable','200
OK',[rfReplaceAll]);
end else
if Pos ('HTTP/1.1 502 Bad Gateway', AThread.NetData) <> 0 then begin
AThread.NetData := StringReplace(athread.NetData,'502 Bad Gateway','200 OK',[rfR
eplaceAll]);
end else
if Pos ('HTTP/1.0 502 Bad Gateway', AThread.NetData) <> 0 then begin
AThread.NetData := StringReplace(athread.NetData,'502 Bad Gateway','200 OK',[rfR
eplaceAll]);
end else
if Pos ('502 Bad Gateway', AThread.NetData) <> 0 then begin
AThread.NetData := StringReplace(athread.NetData,'502 Bad Gateway','200 OK',[rfR
eplaceAll]);
end else
if Pos ('HTTP/1.1 500 Internal Server Error', AThread.NetData) <> 0 then begin
AThread.NetData := StringReplace(athread.NetData,'500 Internal Server Error','20
0 OK',[rfReplaceAll]);
end else
if Pos ('HTTP/1.0 500 Internal Server Error', AThread.NetData) <> 0 then begin
AThread.NetData := StringReplace(athread.NetData,'500 Internal Server Error','20
0 OK',[rfReplaceAll]);
end else
if Pos ('500 Internal Server Error', AThread.NetData) <> 0 then begin
AThread.NetData := StringReplace(athread.NetData,'500 Internal Server Error','20
0 OK',[rfReplaceAll]);
end else
if Pos ('HTTP/1.1 408 Request Time-out', AThread.NetData) <> 0 then begin
AThread.NetData := StringReplace(athread.NetData,'408 Request Time-out','200 OK'
,[rfReplaceAll]);
end else
if Pos ('HTTP/1.0 408 Request Time-out', AThread.NetData) <> 0 then begin
AThread.NetData := StringReplace(athread.NetData,'408 Request Time-out','200 OK'
,[rfReplaceAll]);
end else
if Pos ('408 Request Time-out', AThread.NetData) <> 0 then begin
AThread.NetData := StringReplace(athread.NetData,'408 Request Time-out','200 OK'
,[rfReplaceAll]);
end else
if Pos ('HTTP/1.1 407 Proxy Authentication Required', AThread.NetData) <> 0 then
begin