Форум: "Сети";
Текущий архив: 2002.04.29;
Скачать: [xml.tar.bz2];
ВнизSOCKS5 server Найти похожие ветки
← →
Ghost. (2002-02-17 13:02) [10]unit DXSOCKSV4ServerCore;
interface
///////////////////////////////////////////////////////////////////////////////
// Component: TDXSOCKSV4ServerCore
// Author: Federico "BackDream" Simonetti
// Author: G.E. Ozz Nixon Jr. (administrator@delphix.com)
// Copyright: All code is the property of Brain Patchwork DX (tm) and part of
// the DXSock (r) product, which are (c) 1999 Brain Patchwork DX.
// Version: 2.0 (2nd Generation Code)
// ==========================================================================
///////////////////////////////////////////////////////////////////////////////
uses
Classes,
Windows, {DWORD}
DXServerCore;
{$I DXSOCK.DEF} {2.0}
type
SOCKSV4TSimpleEvent = procedure(ClientThread: TDXServerThread) of object;
SOCKSV4TOtherEvent = procedure(ClientThread: TDXServerThread; Command: string; Parm: string;Var Handled:Boolean) of object;
TDXSOCKSV4ServerCore = class(TDXServerCore)
private
fOnCommandUSER: SOCKSV4TSimpleEvent; {USER john}
fOnCommandOther: SOCKSV4TOtherEvent; {COMMAND parameters...}
fEventArray:TList;
fiTimeout:DWord;
protected
Function GetReleaseDate:String;
Procedure SetReleaseDate(value:string);
Procedure SetOnCommandUSER(value:SOCKSV4TSimpleEvent);
public
{$IFDEF OBJECTS_ONLY}
constructor Create;
{$ELSE}
constructor Create(AOwner:TComponent); override;
{$ENDIF}
destructor Destroy; override;
procedure ProcessSession(ClientThread: TDXServerThread);
Procedure AddBasicEvent(Command:String;EventProc:SOCKSV4TSimpleEvent);
published
property Timeout:DWord read fiTimeout
write fiTimeout;
property OnCommandUSER: SOCKSV4TSimpleEvent read fOnCommandUSER
write SetOnCommandUSER;
property OnCommandOther: SOCKSV4TOtherEvent read fOnCommandOther
write fOnCommandOther;
property ReleaseDate:string read GetReleaseDate
write SetReleaseDate;
end;
implementation
Uses
DXString;
Type
PSOCKSV4SimpleEvent=^TSOCKSV4SimpleEvent;
TSOCKSV4SimpleEvent=record
Tag:Integer;
Command:MySmallString;
EventProcedure:SOCKSV4TSimpleEvent;
End;
(******************************************************************************
*RELEASEDATE:
Used internally to show the date of this release in the object
inspector. Only useful when reporting bugs to development team.
******************************************************************************)
Function TDXSOCKSV4ServerCore.GetReleaseDate:String;
Begin
Result:=BPDX_RELEASE_DATE;
End;
Procedure TDXSOCKSV4ServerCore.SetReleaseDate(value:string);
Begin
// Absorb!
End;
(******************************************************************************
CREATE:
Define the Default Port number to Listen On.
******************************************************************************)
{$IFDEF OBJECTS_ONLY}
constructor TDXSOCKSV4ServerCore.Create;
{$ELSE}
constructor TDXSOCKSV4ServerCore.Create(AOwner:TComponent);
{$ENDIF}
begin
{$IFDEF OBJECTS_ONLY}
inherited Create;
{$ELSE}
inherited Create(AOwner);
{$ENDIF}
ServerPort:=53;
ProtocolToBind:=wpUDPOnly;
fEventArray:=TList.Create;
fiTimeout:=30000;
end;
Страницы: 1 вся ветка
Форум: "Сети";
Текущий архив: 2002.04.29;
Скачать: [xml.tar.bz2];
Память: 0.46 MB
Время: 0.008 c