2010-04-07 17:04:25 -04:00
|
|
|
procedure ps_OpenWebPage( const url : string); extdecl;
|
|
|
|
begin
|
|
|
|
OpenWebPage(url)
|
|
|
|
end;
|
|
|
|
|
|
|
|
function ps_GetPage(const S: String): String; extdecl;
|
2010-01-25 08:59:44 -05:00
|
|
|
begin
|
2010-04-07 08:01:26 -04:00
|
|
|
result := CurrThread.MInternet.GetPage(S);
|
2010-01-25 08:59:44 -05:00
|
|
|
end;
|
2010-02-13 11:56:46 -05:00
|
|
|
|
2010-03-02 16:27:49 -05:00
|
|
|
function ps_InitializeHTTPClient(HandleCookies: Boolean): Integer; extdecl;
|
2010-02-13 11:56:46 -05:00
|
|
|
begin
|
2010-02-20 18:12:51 -05:00
|
|
|
result := CurrThread.MInternet.CreateHTTPClient(HandleCookies);
|
2010-02-13 11:56:46 -05:00
|
|
|
end;
|
|
|
|
|
|
|
|
procedure ps_FreeHTTPClient(Client: Integer); extdecl;
|
|
|
|
begin;
|
2010-03-02 16:27:49 -05:00
|
|
|
CurrThread.MInternet.FreeHTTPClient(client);
|
2010-02-13 11:56:46 -05:00
|
|
|
end;
|
|
|
|
|
2010-04-07 17:04:25 -04:00
|
|
|
function ps_GetHTTPPage(Client: Integer;const URL: string): string; extdecl;
|
2010-02-13 11:56:46 -05:00
|
|
|
begin
|
|
|
|
result := CurrThread.MInternet.GetHTTPClient(Client).GetHTTPPage(url);
|
|
|
|
end;
|
2010-04-07 17:04:25 -04:00
|
|
|
procedure ps_SetHTTPUserAgent(Client: Integer;const Agent: string); extdecl;
|
2010-02-13 11:56:46 -05:00
|
|
|
begin
|
|
|
|
CurrThread.MInternet.GetHTTPClient(Client).SetHTTPUserAgent(agent);
|
|
|
|
end;
|
|
|
|
|
2010-04-07 17:04:25 -04:00
|
|
|
function ps_PostHTTPPage(Client: Integer;const Url,PostData: string): string; extdecl;
|
2010-02-13 11:56:46 -05:00
|
|
|
begin
|
|
|
|
result := CurrThread.MInternet.GetHTTPClient(Client).PostHTTPPage(url,postdata);
|
|
|
|
end;
|
|
|
|
|
2010-04-07 17:04:25 -04:00
|
|
|
function ps_PostHTTPPageEx(Client: Integer;const Url: string): string; extdecl;
|
2010-02-13 11:56:46 -05:00
|
|
|
begin
|
|
|
|
result := CurrThread.MInternet.GetHTTPClient(Client).PostHTTPPage(url);
|
|
|
|
end;
|
|
|
|
|
|
|
|
procedure ps_ClearPostData(Client: Integer); extdecl;
|
|
|
|
begin
|
|
|
|
CurrThread.MInternet.GetHTTPClient(Client).ClearPostData;
|
|
|
|
end;
|
|
|
|
|
2010-04-07 17:04:25 -04:00
|
|
|
procedure ps_AddPostVariable(Client: Integer;const VarName, VarValue: string); extdecl;
|
2010-02-13 11:56:46 -05:00
|
|
|
begin
|
|
|
|
CurrThread.MInternet.GetHTTPClient(Client).AddPostVariable(varname,varvalue);
|
|
|
|
end;
|
|
|
|
|
|
|
|
function ps_GetRawHeaders(Client: Integer): string; extdecl;
|
|
|
|
begin
|
|
|
|
result := CurrThread.MInternet.GetHTTPClient(client).GetRawHeaders;
|
|
|
|
end;
|
2010-06-10 12:35:49 -04:00
|
|
|
|
|
|
|
procedure ps_SetProxy(Client : Integer; pHost, pPort : String); extdecl;
|
|
|
|
begin
|
2010-06-15 12:30:39 -04:00
|
|
|
CurrThread.MInternet.GetHTTPClient(client).SetProxy(pHost, pPort);
|
2010-06-10 12:35:49 -04:00
|
|
|
end;
|
2010-12-18 14:38:29 -05:00
|
|
|
|
|
|
|
function ps_RecvSocketStr(Client: integer): string;
|
|
|
|
begin
|
|
|
|
Result := CurrThread.Socks.GetSocket(Client).RecvString;
|
|
|
|
end;
|
|
|
|
|
|
|
|
function ps_RecvSocket(Client: integer): string;
|
|
|
|
begin
|
|
|
|
Result := CurrThread.Socks.GetSocket(Client).Recv;
|
|
|
|
end;
|
|
|
|
|
|
|
|
function ps_RecvSocketEx(Client, Length: integer): string;
|
|
|
|
begin
|
|
|
|
Result := CurrThread.Socks.GetSocket(Client).RecvBufferStr(Length);
|
|
|
|
end;
|
|
|
|
|
|
|
|
procedure ps_SendSocket(Client: integer; Data: string);
|
|
|
|
begin
|
|
|
|
CurrThread.Socks.GetSocket(Client).Send(Data);
|
|
|
|
end;
|
|
|
|
|
|
|
|
procedure ps_ConnectSocket(Client: integer; IP, Port: string);
|
|
|
|
begin
|
|
|
|
CurrThread.Socks.GetSocket(Client).Connect(IP, Port);
|
|
|
|
end;
|
|
|
|
|
|
|
|
procedure ps_CloseSocket(Client: integer);
|
|
|
|
begin
|
|
|
|
CurrThread.Socks.GetSocket(Client).Close;
|
|
|
|
end;
|
|
|
|
|
|
|
|
procedure ps_SetSocketTimeout(Client, Time: integer);
|
|
|
|
begin
|
|
|
|
CurrThread.Socks.GetSocket(Client).SetTimeout(Time);
|
|
|
|
end;
|
|
|
|
|
|
|
|
procedure ps_BindSocket(Client: integer; IP, Port: string);
|
|
|
|
begin
|
|
|
|
CurrThread.Socks.GetSocket(Client).Bind(IP, Port);
|
|
|
|
end;
|
|
|
|
|
|
|
|
procedure ps_ListenSocket(Client: integer);
|
|
|
|
begin
|
|
|
|
CurrThread.Socks.GetSocket(Client).Listen;
|
|
|
|
end;
|
|
|
|
|
|
|
|
function ps_AcceptSocket(Client: integer): integer;
|
|
|
|
begin
|
|
|
|
Result := CurrThread.Socks.CreateSocketEx(CurrThread.Socks.GetSocket(Client).Accept);
|
|
|
|
end;
|
|
|
|
|
2011-01-12 20:17:43 -05:00
|
|
|
procedure ps_SocketInfo(Client: integer; out IP, Port: string);
|
|
|
|
begin
|
|
|
|
CurrThread.Socks.GetSocket(Client).Info(IP, Port);
|
|
|
|
end;
|
|
|
|
|
2010-12-18 14:38:29 -05:00
|
|
|
function ps_CreateSocket: integer; extdecl;
|
|
|
|
begin
|
|
|
|
Result := CurrThread.Socks.CreateSocket();
|
|
|
|
end;
|
|
|
|
|
|
|
|
procedure ps_FreeSocket(Client: integer); extdecl;
|
|
|
|
begin;
|
|
|
|
CurrThread.Socks.FreeSocket(Client);
|
|
|
|
end;
|