基本信息
源码名称:Socks5代理演示程序-DELPHI
源码大小:0.01M
文件格式:.rar
开发语言:Pascal
更新时间:2020-08-17
   友情提示:(无需注册或充值,赞助后即可获取资源下载链接)

     嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):813200300

本次赞助数额为: 2 元 
   源码介绍
Socks5代理演示程序-DELPHI

unction connect_proxy(skt: TSocket; target: TSockAddr): boolean;

var
  buf: array[0..1023] of byte;
  re: integer;
begin
    //preapre
  buf[0] := SOCKS_VER5;
  buf[1] := CMD_CONNECT;
  buf[2] := RSV_DEFAULT;
  buf[3] := ATYP_IPV4;
    //copy data
  copymemory(@buf[4], @target.sin_addr, 4);
  copymemory(@buf[8], @target.sin_port, 2);
    //communicate
  re := send(skt, buf, 10, 0);
  if re = -1 then
  begin
    result := false;
    exit;
  end;
  re := recv(skt, buf, 1024, 0);
  if re = -1 then
  begin
    result := false;
    exit;
  end;
  if buf[1] <> REP_SUCCESS then
  begin
    result := false;
    exit;
  end;
  result := true;
end;