Skip to content

ProSocks v0.5

Compare
Choose a tag to compare
@Brandon-T Brandon-T released this 29 Nov 03:24
· 2 commits to master since this release
  • Uses tagged record syntax.
  • Updated compile flags and pre-processor flags for compiling on both Windows, OSX, and Linux.

Pascal:

Function GetPage(var url: String): String;
var
    sock: SSLSocket;
    data: MemoryStruct;
begin
    sock.Init();
    sock.setURL(url);
    sock.setSecurityPolicy(false, false, true);
    sock.setURLFollow(false);
    sock.doGet(data);

    SetLength(result, data.size);
    MemMove(data.memory^, result[1], data.size);

    sock.Free();
end;

begin
    writeln(GetPage('https://github.com/Brandon-T/ProSocks');
end;

C:

#include <SSLSocket.h>

int main(int argc, const char * argv[])
{
    SSLSocket sock = {0};
    SSLSocket_Init(&sock);
    SSLSocket_SetSecurityPolicy(&sock, false, false, true);
    SSLSocket_SetURLFollow(&sock, true);
    SSLSocket_SetURL(&sock, "https://github.com/Brandon-T/ProSocks");

    ProMemoryStruct* mem = SSLSocket_DoPost(&sock);

    printf("%.*s", mem->size, mem->data);

    SSLSocket_Free(&sock);
}