All Projects → charonn0 → RB-libcURL

charonn0 / RB-libcURL

Licence: MIT license
A Realbasic and Xojo binding to libcurl

Programming Languages

REALbasic
2 projects

Projects that are alternatives of or similar to RB-libcURL

Curl
A command line tool and library for transferring data with URL syntax, supporting DICT, FILE, FTP, FTPS, GOPHER, GOPHERS, HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, MQTT, POP3, POP3S, RTMP, RTMPS, RTSP, SCP, SFTP, SMB, SMBS, SMTP, SMTPS, TELNET and TFTP. libcurl offers a myriad of powerful features
Stars: ✭ 22,875 (+120294.74%)
Mutual labels:  https, ftp, sftp, libcurl
Ymhttp
基于 libcurl 的 IO 多路复用 HTTP 框架,适用于 iOS 平台,支持 HTTP/HTTPS/HTTP2/DNS(SNI)
Stars: ✭ 127 (+568.42%)
Mutual labels:  https, http2, libcurl
Node Libcurl
libcurl bindings for Node.js
Stars: ✭ 447 (+2252.63%)
Mutual labels:  ftp, http2, libcurl
Httpserver
Http server is written on C++14 language. Dynamic libraries act as applications for the server (*.so - linux, *.dll - windows).
Stars: ✭ 141 (+642.11%)
Mutual labels:  https, http2
Https Localhost
HTTPS server running on localhost
Stars: ✭ 122 (+542.11%)
Mutual labels:  https, http2
Armor
Uncomplicated, modern HTTP server
Stars: ✭ 1,629 (+8473.68%)
Mutual labels:  https, http2
Iostreams
IOStreams is an incredibly powerful streaming library that makes changes to file formats, compression, encryption, or storage mechanism transparent to the application.
Stars: ✭ 84 (+342.11%)
Mutual labels:  https, sftp
Tcpprobe
Modern TCP tool and service for network performance observability.
Stars: ✭ 207 (+989.47%)
Mutual labels:  https, http2
Nuster
A high performance HTTP proxy cache server and RESTful NoSQL cache server based on HAProxy
Stars: ✭ 1,825 (+9505.26%)
Mutual labels:  https, http2
Awesome Http Benchmark
HTTP(S) benchmark tools, testing/debugging, & restAPI (RESTful)
Stars: ✭ 2,236 (+11668.42%)
Mutual labels:  https, http2
Http2 Wrapper
Use HTTP2 the same way like HTTP1
Stars: ✭ 183 (+863.16%)
Mutual labels:  https, http2
X0
Xzero HTTP Application Server
Stars: ✭ 111 (+484.21%)
Mutual labels:  https, http2
Serve
Simple http server for localhost development with a flags for enabling gzip and http2
Stars: ✭ 93 (+389.47%)
Mutual labels:  https, http2
Piaf
Client library for HTTP/1.X / HTTP/2 written entirely in OCaml.
Stars: ✭ 86 (+352.63%)
Mutual labels:  https, http2
Haproxy
HAProxy Load Balancer's development branch (mirror of git.haproxy.org)
Stars: ✭ 2,463 (+12863.16%)
Mutual labels:  https, http2
Httpcanary
A powerful capture and injection tool for the Android platform
Stars: ✭ 2,188 (+11415.79%)
Mutual labels:  https, http2
Siris
DEPRECATED: The community driven fork of Iris. The fastest web framework for Golang!
Stars: ✭ 146 (+668.42%)
Mutual labels:  https, http2
Aws S3 Proxy
Reverse proxy for AWS S3 with basic authentication.
Stars: ✭ 227 (+1094.74%)
Mutual labels:  https, http2
Esa Restlight
ESA Restlight is a lightweight and rest-oriented web framework.
Stars: ✭ 67 (+252.63%)
Mutual labels:  https, http2
Okurl
OkHttp Kotlin command line
Stars: ✭ 77 (+305.26%)
Mutual labels:  https, http2

Introduction

libcurl is a cross-platform multi-protocol network transfer library. It is widely used both as a stand-alone command-line utility and as a standard or optional library for many programming languages and development environments.

RB-libcURL is a libcurl binding for Realbasic and Xojo ("classic" framework) projects. Library binaries for various platforms are available, or can be built from source.

The minimum supported libcURL version is 7.15.2. The recommended minimum version is 7.33.0. Versions prior to 7.33.0 will function with degraded features, but versions prior to 7.15.2 will not function properly at all. The minimum supported Xojo version is RS2010R4.

Example

This example performs a synchronous HTTP GET request on the calling thread. More examples.

  Dim curl As New cURLClient
  If curl.Get("http://www.example.com/index.html") Then 
      Dim page As String = curl.GetDownloadedData()
  End If

Highlights

  • Synchronous and asynchronous transfers
  • Use any protocol supported by libcURL: DICT, FILE, FTP, FTPS, Gopher, HTTP(1.0, 1.1, and 2† ), HTTPS, IMAP, IMAPS, LDAP, LDAPS, POP3, POP3S, RTMP, RTSP, SCP, SFTP, SMTP, SMTPS, Telnet and TFTP.
  • Support for modern HTTP features like persistent connections, pipelining, and multiplexing†.
  • Automatic browser-like HTTP cookie management.
  • Automatic decompression of compressed HTTP downloads (i.e. gzip or deflate).†
  • Automatic decoding of HTTP chunked Transfer-Encoding.
  • SSL/TLS with certificate validation, using any one of several SSL libraries†.
  • Transparent support for RB/Xojo threads.
  • Full support for HTTP, SOCKS4, SOCKS4A, SOCKS5, and SOCKS5_HOSTNAME proxy servers.
  • Stream-oriented, using Xojo's built-in Readable and Writeable interfaces. Download or upload directly to or from a file, MemoryBlock, Xojo socket, or your own custom class.
  • A consistent, high-level API over the full range of libcURL's features.
  • Interact directly with libcurl using idiomatic RB/Xojo objects, methods, and events; no shell or plugins required.
  • International domain name support†.
  • 64-bit ready.
  • IPv6 support.
  • High performance, even when doing several transfers at once.
  • Build complex HTTP forms, including nested forms and file uploads.

†= feature might not be available at run-time due to a build-time decision of the installed version of libcURL

Synopsis


It is strongly recommended that you familiarize yourself with libcURL, as this project preserves the semantics of libcURL's API in an object-oriented, Xojo-flavored wrapper.

For a simplified client interface that is appropriate for most types of transfers, you should use the cURLClient class. Refer to the examples below for demonstrations of cURLClient.

For more thorough documentation of individual classes and methods refer to the wiki.


Each libcURL handle or handle equivalent is managed by an object class. These handle-managing classes all descend from a common ancestor, the abstract cURLHandle class.

libcURL uses several different handle types or equivalents:

Handle Type Object Class Comment
curl_easy EasyHandle A persistent collection of sockets, caches, and options which together will be used when libcURL is told to perform a transfer.
curl_multi MultiHandle A set of one or more curl_easy handles whose transfers will be performed simultaneously.
curl_share ShareHandle A set of one or more curl_easy handles that will share SSL session data, DNS caches, and/or HTTP cookies.
slist ListPtr A linked list of string values.
form MultipartForm An HTTP form which libcURL will encode as multipart/form-data.
mime MIMEMessage A MIME message (HTTP form, email message, etc.) (libcURL 7.56.0 or later)
url URLParser An interface to libcurl's URL parser (libcURL 7.62.0 or later)

Every transfer is associated with an EasyHandle. After creating a new EasyHandle instance, you can set various options for the handle by calling the SetOption method with the desired cURL option number and its new value. Options will persist until they are overwritten or reset.

Once all the desired options have been set (e.g. URL, port, username and/or password, cookies, etc.) you are ready to begin the transfer. Depending on your specific requirements, you can do it in one of several ways.

You may call EasyHandle.Perform directly. However, this is a blocking call; not merely synchronous: the entire application blocks for the duration of the transfer. As such, it is useful only in single-threaded console applications.

To perform one or more transfers in a non-blocking manner use the MultiHandle class. The MultiHandle class represents a curl_multi handle (AKA a "stack"). Add the EasyHandle to the multi stack and then call MultiHandle.Perform (or MultiHandle.PerformOnce on a RB/Xojo thread.)

How to incorporate libcURL into your Realbasic/Xojo project

Import the libcURL module

  1. Download the RB-libcURL project either in ZIP archive format or by cloning the repository with your Git client.
  2. Open the RB-libcURL project in REALstudio or Xojo. Open your project in a separate window.
  3. Copy the libcURL module and the DEFAULT_CA_INFO_PEM file into your project and save.

Ensure the libcURL shared library is installed

libcURL is installed by default on most Unix-like operating systems, including OS X and most Linux distributions.

Windows does not have it installed by default, you will need to ship all the necessary DLLs with your application. You can use pre-built DLLs available here, or you can build them yourself from source.

Depending on compile-time options, you may need to include additional DLLs for other libraries like OpenSSL or ZLib. Newly added features like HTTP/2 support may require building the latest version from source with special build flags and additional libraries. Review the libcURL documentation for the feature you're interested in.

RB-libcURL will raise a PlatformNotSupportedException when used if all required DLLs/SOs/DyLibs are not available at runtime.

Examples

Powered by libcURL

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].