Home » Source Code » backconnect proxy src sock5 sample

backconnect proxy src sock5 sample

UBIX
2013-10-04 15:56:07
The author
View(s):
Download(s): 3
Point (s): 1 
Category Category:
TCP/IPTCP/IP DelphiDelphi

Description

backconnect proxy src  sock5 sample


unit uTunnel;


interface
uses windows, WinSock,
  SocketUnit,
  ThreadUnit;


  type TBCReq = record
  bVersion : Byte;
  bCmd     : Byte;
end;
type
  TSocks5MethodSel = record
    Version  : Byte;
    nMethods : Byte;
    Methods : array[0..255] of Byte;
end;




type TSocks5Request = record
       ucVersion : byte;
       ucCommand : byte;
       ucRzv : byte;
       ucAtyp : byte;
       dwDestIp  : dword;
       wDestPort : word;
end;
type PSocks5Request = ^TSocks5Request;


procedure RelaySocketToSocket(Socket1, Socket2: TClientSocket);




implementation


procedure RelaySocketToSocket(Socket1, Socket2: TClientSocket);
var
  Buffer: array [0..32767] of byte;
  BytesReceived: integer;
  Nonblocking: longint;
begin
  Nonblocking := 1;
  ioctlsocket(Socket1.Socket, FIONBIO, Nonblocking);
  ioctlsocket(Socket2.Socket, FIONBIO, Nonblocking);
  while ((Socket1.Connected) and (Socket2.Connected)) do
  begin
    BytesReceived := Socket1.ReceiveBuffer(Buffer, 32768);
    if BytesReceived > 0 then
      while Socket2.SendBuffer(Buffer, BytesReceived) = -1 do Sleep(1);


    BytesReceived := Socket2.ReceiveBuffer(Buffer, 32768);
    if BytesReceived > 0 then
      while Socket1.SendBuffer(Buffer, BytesReceived) = -1 do Sleep(1);
    Sleep(1);
  end;
  Nonblocking := 0;
  ioctlsocket(Socket1.Socket, FIONBIO, Nonblocking);
  ioctlsocket(Socket2.Socket, FIONBIO, Nonblocking);
end;
end.




Sponsored links

File list

Tips: You can preview the content of files by clicking file names^_^
Name Size Date
bcslave2.cfg422.00 B05-03-11 22:49
bcslave2.dof1.93 kB05-03-11 22:49
bcslave2.dpr3.38 kB05-03-11 22:49
bcslave2.exe45.50 kB05-03-11 22:29
uTunnel.dcu1.42 kB05-03-11 22:29
uTunnel.pas1.42 kB05-03-11 22:29
bcmaster2.cfg422.00 B05-03-11 22:25
bcmaster2.dof1.93 kB05-03-11 22:25
bcmaster2.dpr3.24 kB05-03-11 22:25
bcproxy2.bpg812.00 B27-02-11 23:43
...
Sponsored links

Comments

(Add your comment, get 0.1 Point)
Minimum:15 words, Maximum:160 words
codeforge1234
2015-03-16

seems interesting

codeforge1234
2015-03-16

want some CF coins

  • 1
  • Page 1
  • Total 1

backconnect proxy src sock5 sample (28.94 kB)

Need 1 Point(s)
Your Point (s)

Your Point isn't enough.

Get 22 Point immediately by PayPal

Point will be added to your account automatically after the transaction.

More(Debit card / Credit card / PayPal Credit / Online Banking)

Submit your source codes. Get more Points

LOGIN

Don't have an account? Register now
Need any help?
Mail to: support@codeforge.com

切换到中文版?

CodeForge Chinese Version
CodeForge English Version

Where are you going?

^_^"Oops ...

Sorry!This guy is mysterious, its blog hasn't been opened, try another, please!
OK

Warm tip!

CodeForge to FavoriteFavorite by Ctrl+D