New curl plugin

Started by habi, Aug 17, 2023, 06:56 PM

Previous topic - Next topic

habi

Hi past two days, i was building libcurl( the curl dll for c++ ) under various operating system. It was quite hard, because it need another libraries like openssl and libssh.
Anyhow, i completed all this and i have 4 plugins (for 32/64/windows/linux) for vcmp server.

It's only function is this:
SendRequest("https://www.example.com", function(data){ //do something with data } );Yes, it sends a get request and calls the given function when receiving data.

Download links
curlget-binaries.zip

Function Documentation
1. SendRequest( [string]url, callback )
url: the url to connect to
callback: the one parameter function (like print) which will be called when data is received.
returns null always

Notes
1. SendRequest is not blocking call.

Limitations
1. post request is not supported.

Example code and output
SendRequest("https://www.example.com",print)Output


Source code
1. curlget-source.zip

2. It needs curl library to compile. I am including the libcurl binaries compiled by me ( with openssl in linux, and windows sspi in windows ).
libcurl-binaries.zip

Building from source
How to build from source?
-------------------------
To build you need libcurl libraries and curl include directory in hand. I have libcurl.so in /home/user/libcurl/lib and curl include files are in the folder curl of this project.
../curlget$ mkdir out2
../curlget$ cd out2
../out2$    cmake ../ -DCURL_LIBRARY=/home/user/libcurl/lib/libcurl.so -DCURL_INCLUDE_DIR=../curl
-- Found CURL: /home/user/libcurl/lib/libcurl.so
-- Configuring done
-- Generating done
-- Build files have been written to: ***/curlget/out2
../out2$    cmake --build .
[ 50%] Linking CXX shared module curlget04rel64.so
Copying to output directory
[100%] Built target curlget
On Windows, you need the static libcurl library and not (*.dll)
For building for 32bit in a 64 bit linux, add -DFORCE_32=1
For building 32 bit in windows, add  -DCMAKE_GENERATOR_PLATFORM=Win32
Attributions
"This product includes software developed by the OpenSSL Project
 *    for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
"This product includes cryptographic software written by
 *    Eric Young ([email protected])"

Ridwan Rz

A Noob Question: What can you do with this?

habi