Rust bindings to libcurl

Overview

curl-rust

libcurl bindings for Rust

Latest Version Documentation License Build

Quick Start

use std::io::{stdout, Write};

use curl::easy::Easy;

// Print a web page onto stdout
fn main() {
    let mut easy = Easy::new();
    easy.url("https://www.rust-lang.org/").unwrap();
    easy.write_function(|data| {
        stdout().write_all(data).unwrap();
        Ok(data.len())
    }).unwrap();
    easy.perform().unwrap();

    println!("{}", easy.response_code().unwrap());
}
use curl::easy::Easy;

// Capture output into a local `Vec`.
fn main() {
    let mut dst = Vec::new();
    let mut easy = Easy::new();
    easy.url("https://www.rust-lang.org/").unwrap();

    let mut transfer = easy.transfer();
    transfer.write_function(|data| {
        dst.extend_from_slice(data);
        Ok(data.len())
    }).unwrap();
    transfer.perform().unwrap();
}

Post / Put requests

The put and post methods on Easy can configure the method of the HTTP request, and then read_function can be used to specify how data is filled in. This interface works particularly well with types that implement Read.

use std::io::Read;
use curl::easy::Easy;

fn main() {
    let mut data = "this is the body".as_bytes();

    let mut easy = Easy::new();
    easy.url("http://www.example.com/upload").unwrap();
    easy.post(true).unwrap();
    easy.post_field_size(data.len() as u64).unwrap();

    let mut transfer = easy.transfer();
    transfer.read_function(|buf| {
        Ok(data.read(buf).unwrap_or(0))
    }).unwrap();
    transfer.perform().unwrap();
}

Custom headers

Custom headers can be specified as part of the request:

use curl::easy::{Easy, List};

fn main() {
    let mut easy = Easy::new();
    easy.url("http://www.example.com").unwrap();

    let mut list = List::new();
    list.append("Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==").unwrap();
    easy.http_headers(list).unwrap();
    easy.perform().unwrap();
}

Keep alive

The handle can be re-used across multiple requests. Curl will attempt to keep the connections alive.

use curl::easy::Easy;

fn main() {
    let mut handle = Easy::new();

    handle.url("http://www.example.com/foo").unwrap();
    handle.perform().unwrap();

    handle.url("http://www.example.com/bar").unwrap();
    handle.perform().unwrap();
}

Multiple requests

The libcurl library provides support for sending multiple requests simultaneously through the "multi" interface. This is currently bound in the multi module of this crate and provides the ability to execute multiple transfers simultaneously. For more information, see that module.

Building

By default, this crate will attempt to dynamically link to the system-wide libcurl and the system-wide SSL library. Some of this behavior can be customized with various Cargo features:

  • ssl: Enable SSL/TLS support using the platform-default TLS backend. On Windows this is Schannel, on macOS Secure Transport, and OpenSSL (or equivalent) on all other platforms. Enabled by default.
  • mesalink: Enable SSL/TLS support via MesaLink, an alternative TLS backend written in Rust based on Rustls. MesaLink is always statically linked. Disabled by default.
  • http2: Enable HTTP/2 support via libnghttp2. Disabled by default.
  • static-curl: Use a bundled libcurl version and statically link to it. Disabled by default.
  • static-ssl: Use a bundled OpenSSL version and statically link to it. Only applies on platforms that use OpenSSL. Disabled by default.
  • spnego: Enable SPNEGO support. Disabled by default.

Version Support

The bindings have been developed using curl version 7.24.0. They should work with any newer version of curl and possibly with older versions, but this has not been tested.

Troubleshooting

Curl built against the NSS SSL library

If you encounter the following error message:

  [77] Problem with the SSL CA cert (path? access rights?)

That means most likely, that curl was linked against libcurl-nss.so due to installed libcurl NSS development files, and that the required library libnsspem.so is missing. See also the curl man page: "If curl is built against the NSS SSL library, the NSS PEM PKCS#11 module (libnsspem.so) needs to be available for this option to work properly."

In order to avoid this failure you can either

  • install the missing library (e.g. Debian: nss-plugin-pem), or
  • remove the libcurl NSS development files (e.g. Debian: libcurl4-nss-dev) and rebuild curl-rust.

License

The curl-rust crate is licensed under the MIT license, see LICENSE for more details.

Comments
  • Building on windows, tutorial and suggestions

    Building on windows, tutorial and suggestions

    I am happy to help by writing out the details in markdown somewhere but I think this issue of building this crate on windows should be addressed. Currently, on a standard version of windows without linux tools installed such as sh, this build will fail. This came up when I was trying to install cargo-edit on windows via cargo install cargo-edit which is one of my favorite linux programs for working with rust. I did receive the useful message "is sh not installed?" but it was perhaps a bit too short. Sadly, in version 0.2.18 that is used by cargo-edit, this message did not appear. I found the message by cloning this repo and trying to build. I still do not know the best way forward. Is MinGW expected? Something else?

    Thanks for the advice. I think whatever information is included in the answer should in some way probably be added to the readme.

    opened by waynenilsen 16
  • windows build under msys2 fails with config.guess issue

    windows build under msys2 fails with config.guess issue

    Building under MSYS2 (with a msys2 fresh build of rust) fails, because config.guess can't figure out the system triple. Updating the curl source to have the latest config.guess/config.sub fixes this.

    opened by vvuk 16
  • curl::multi::Multi will make double free memory problem when some ssl error occurred

    curl::multi::Multi will make double free memory problem when some ssl error occurred

    Problem

    OS: CentOS Linux release 7.3.1611 (Core)

    Use curl::multi::Multi to fetch more than one https url will cause the program to crash when some ssl error occurred(rel issue):

    [root@hugo-devm-b4pc3 easycurl]# cargo run
       Compiling easycurl v0.1.0 (/mnt/vdc1/home/apps/easycurl)
        Finished dev [unoptimized + debuginfo] target(s) in 0.58s
         Running `target/debug/easycurl`
    result for easy with token 0: Some(Err(Error { description: "SSL peer certificate or SSH remote key was not OK", code: 60, extra: Some("SSL: certificate subject name 'Test' does not match target host name '127.0.0.1'") }))
    *** Error in `target/debug/easycurl': double free or corruption (!prev): 0x00007f74f921f4e0 ***
    ======= Backtrace: =========
    /lib64/libc.so.6(+0x7c503)[0x7f74f6dec503]
    /apps/svr/curl/lib/libcurl.so.4(+0x57d08)[0x7f74f7cc9d08]
    /apps/svr/curl/lib/libcurl.so.4(+0x58c3c)[0x7f74f7ccac3c]
    /apps/svr/curl/lib/libcurl.so.4(+0x1132c)[0x7f74f7c8332c]
    /apps/svr/curl/lib/libcurl.so.4(curl_multi_cleanup+0xbf)[0x7f74f7cafbff]
    target/debug/easycurl(_ZN63_$LT$curl..multi..RawMulti$u20$as$u20$core..ops..drop..Drop$GT$4drop17h76af921506dcf405E+0x12)[0x7f74f87a6a22]
    target/debug/easycurl(_ZN4core3ptr42drop_in_place$LT$curl..multi..RawMulti$GT$17h3353ba6689bfbe2eE+0xb)[0x7f74f87a4f0b]
    target/debug/easycurl(_ZN5alloc4sync12Arc$LT$T$GT$9drop_slow17h56cde95cf342e66dE+0x24)[0x7f74f87a2de4]
    target/debug/easycurl(_ZN67_$LT$alloc..sync..Arc$LT$T$GT$$u20$as$u20$core..ops..drop..Drop$GT$4drop17hb73c8a2d4d00a004E+0x63)[0x7f74f87a2f43]
    target/debug/easycurl(_ZN4core3ptr66drop_in_place$LT$alloc..sync..Arc$LT$curl..multi..RawMulti$GT$$GT$17he1315d4334cfd101E+0xb)[0x7f74f87a573b]
    target/debug/easycurl(+0x24657)[0x7f74f879b657]
    target/debug/easycurl(+0x2565f)[0x7f74f879c65f]
    target/debug/easycurl(+0x245db)[0x7f74f879b5db]
    target/debug/easycurl(+0x25e6e)[0x7f74f879ce6e]
    target/debug/easycurl(+0x26ba1)[0x7f74f879dba1]
    target/debug/easycurl(_ZN3std2rt19lang_start_internal17h571831ebdba142deE+0x431)[0x7f74f87d4e81]
    target/debug/easycurl(+0x26b70)[0x7f74f879db70]
    target/debug/easycurl(+0x25c4c)[0x7f74f879cc4c]
    /lib64/libc.so.6(__libc_start_main+0xf5)[0x7f74f6d91b35]
    target/debug/easycurl(+0x23d69)[0x7f74f879ad69]
    

    Rust code

    ///
    /// Simulate cargo download_accessible to reproduce crash issue https://github.com/rust-lang/cargo/issues/10034
    ///
    use curl::easy::{Easy, HttpVersion};
    use curl::multi::{EasyHandle, Multi};
    use curl::Error as CurlError;
    
    fn main() {
        let ret = {
            let mut multi = Multi::new();
            multi.pipelining(false, true).unwrap();
            multi.set_max_host_connections(2).unwrap();
            let mut handles = Vec::new();
            handles.push(add_easy_to_multi(&mut multi, handles.len()));
            // push more than one EasyHandle to trigger crash
            handles.push(add_easy_to_multi(&mut multi, handles.len()));
            let (token, result) = wait_for_curl(&mut multi, &handles);
            let handle = handles.remove(token);
            multi.remove(handle).unwrap();
            /*
            // comment out this loop it won't crash
            while !handles.is_empty() {
                let handle = handles.pop().unwrap();
                multi.remove(handle).unwrap();
            }
             */
            result
        };
        {
            println!("wait for url: {:?}", ret);
        }
    }
    
    fn add_easy_to_multi(multi: &mut Multi, token: usize) -> EasyHandle {
        let mut easy = Easy::new();
        easy.get(true).unwrap();
        easy.url("https://127.0.0.1:443").unwrap();
        easy.follow_location(true).unwrap();
        easy.http_version(HttpVersion::V2).unwrap();
        easy.pipewait(true).unwrap();
        easy.ssl_verify_peer(false).unwrap(); // comment out this line it won't crash
        easy.write_function(move |data| {
            println!("easy with token {} read {} bytes", token, data.len());
            Ok(data.len())
        }).unwrap();
    
        let mut h = multi.add(easy).unwrap();
        h.set_token(token).unwrap();
        h
    }
    
    fn wait_for_curl(multi: &mut Multi, handles: &Vec<EasyHandle>) -> (usize, Option<Result<(), CurlError>>) {
        let mut e = None;
        let mut out_token = 0usize;
        loop {
            multi.perform().unwrap();
            multi.messages(|msg| {
                let token = msg.token().unwrap();
                let r = msg.result_for(&handles[token]);
                println!("result for easy with token {}: {:?}", token, r);
                e = r;
                out_token = token;
            });
            if e.is_some() {
                break;
            }
            multi.wait(&mut [], std::time::Duration::from_secs(5)).unwrap();
        }
        (out_token, e)
    }
    

    The url https://127.0.0.1:433 in the code is a service implemented by the simple golang code:

    package main
    
    import (
        "fmt"
        "net/http"
    )
    
    func handler(w http.ResponseWriter, r *http.Request) {
        fmt.Fprintf(w, "It works!")
    }
    
    func main() {
        http.HandleFunc("/", handler)
        http.ListenAndServeTLS(":443", "server.crt", "server.key", nil)
    }
    

    server.crt is a self signed certificate generated by OpenSSL, you can replace with your version.

    Cargo.toml

    [package]
    name = "easycurl"
    version = "0.1.0"
    edition = "2021"
    
    # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
    
    [dependencies]
    curl = { version = "0.4.40", features = ["http2"] }
    curl-sys = "0.4.50"
    

    curl -V:

    libcurl/7.80.0-DEV OpenSSL/1.1.1h zlib/1.2.7 libidn2/2.3.1 nghttp2/1.41.0
    
    opened by iiibui 14
  • Add support for in-memory certificates

    Add support for in-memory certificates

    This adds support for passing SSL certificates as in-memory blobs using several new options added in libcurl 7.71.0:

    Notably, this PR does not add support for CURLOPT_PROXY_ISSUERCERT_BLOB since this crate does not presently support CURLOPT_PROXY_ISSUERCERT (and adding support for that is somewhat orthogonal to this PR).

    In order to implement the above, this PR also adds support for the new CURLOPTTYPE_BLOB option type (and the corresponding Curl_setblobopt setter function). Although the C API allows the caller to specify whether the data should be copied or not, the safe interface here always copies the data since there doesn't seem to be a straightforward way to make the lifetimes work out otherwise.

    I'm not sure how to add automated tests for this since this crate's test suite currently doesn't seem to be able to test SSL at all. I've been able to verify that this works in small test programs on Linux/OpenSSL using P12 certificates, but have not tested on other platforms using other certificate formats and SSL engines.

    opened by kulshrax 14
  • Add support for curl_easy_upkeep

    Add support for curl_easy_upkeep

    Add feature-gated support for curl_easy_upkeep, introduced in 7.62.0


    Happy to discuss feature naming, etc! Would be nice to have a model for adding in features that have been introduced within the last 9 years.

    opened by cmeister2 14
  • added unix-sockets feature support

    added unix-sockets feature support

    Related to https://github.com/alexcrichton/curl-rust/issues/297

    Example:

    let mut easy = Easy::new();
    easy.unix_socket("/var/socket_path.sock")?;
    easy.url("http://localhost/path")?;
    
    opened by gngeorgiev 14
  • Failed to cross-compile the example program from x86_64 Linux

    Failed to cross-compile the example program from x86_64 Linux

    I built a Rust 1.2.0 compiler under Fedora (x86_64) which supported multiple targets including x86_64-pc-windows-gnu and arm-unknown-linux-gnueabihf and successfully compiled some simple programs.

    However, I failed to cross-compile the example program from curl-rust. (I can compile the example directly under Windows, haven't tried under ARM.)

    When building for x86_64-pc-windows-gnu, I got:

         Compiling curl_example v0.1.0 (file:///home/frederick/rust/curl_example)
         Running `rustc src/main.rs --crate-name curl_example --crate-type bin -C opt-level=3 --out-dir /home/frederick/rust/curl_example/target/x86_64-pc-windows-gnu/release --emit=dep-info,link --target x86_64-pc-windows-gnu -C ar=x86_64-w64-mingw32-ar -C linker=x86_64-w64-mingw32-gcc -L dependency=/home/frederick/rust/curl_example/target/x86_64-pc-windows-gnu/release -L dependency=/home/frederick/rust/curl_example/target/x86_64-pc-windows-gnu/release/deps --extern curl=/home/frederick/rust/curl_example/target/x86_64-pc-windows-gnu/release/deps/libcurl-8828a61714ae0eb4.rlib -L /home/frederick/rust/curl_example/target/x86_64-pc-windows-gnu/release/build/curl-sys-b582fd2220a1331e/out/lib`
    error: linking with `x86_64-w64-mingw32-gcc` failed: exit code: 1
    note: "x86_64-w64-mingw32-gcc" "-Wl,--enable-long-section-names" "-fno-use-linker-plugin" "-Wl,--nxcompat" "-static-libgcc" "-m64" "-L" "/usr/local/lib/rustlib/x86_64-pc-windows-gnu/lib" "/home/frederick/rust/curl_example/target/x86_64-pc-windows-gnu/release/curl_example.o" "-o" "/home/frederick/rust/curl_example/target/x86_64-pc-windows-gnu/release/curl_example.exe" "-Wl,--gc-sections" "/home/frederick/rust/curl_example/target/x86_64-pc-windows-gnu/release/deps/libcurl-8828a61714ae0eb4.rlib" "/home/frederick/rust/curl_example/target/x86_64-pc-windows-gnu/release/deps/libcurl_sys-b582fd2220a1331e.rlib" "/home/frederick/rust/curl_example/target/x86_64-pc-windows-gnu/release/deps/liburl-5247f81b4a7b5841.rlib" "/home/frederick/rust/curl_example/target/x86_64-pc-windows-gnu/release/deps/libmatches-68291f81832fc22d.rlib" "/home/frederick/rust/curl_example/target/x86_64-pc-windows-gnu/release/deps/liblog-8a6aba167994951e.rlib" "/home/frederick/rust/curl_example/target/x86_64-pc-windows-gnu/release/deps/liblibz_sys-e8e1552876cd3abe.rlib" "/home/frederick/rust/curl_example/target/x86_64-pc-windows-gnu/release/deps/liblibc-144c435538abd757.rlib" "/home/frederick/rust/curl_example/target/x86_64-pc-windows-gnu/release/deps/librustc_serialize-7ff5bfc027146194.rlib" "/usr/local/lib/rustlib/x86_64-pc-windows-gnu/lib/libstd-d8ace771.rlib" "/usr/local/lib/rustlib/x86_64-pc-windows-gnu/lib/libcollections-d8ace771.rlib" "/usr/local/lib/rustlib/x86_64-pc-windows-gnu/lib/librustc_unicode-d8ace771.rlib" "/usr/local/lib/rustlib/x86_64-pc-windows-gnu/lib/librand-d8ace771.rlib" "/usr/local/lib/rustlib/x86_64-pc-windows-gnu/lib/liballoc-d8ace771.rlib" "/usr/local/lib/rustlib/x86_64-pc-windows-gnu/lib/liblibc-d8ace771.rlib" "/usr/local/lib/rustlib/x86_64-pc-windows-gnu/lib/libcore-d8ace771.rlib" "-L" "/home/frederick/rust/curl_example/target/x86_64-pc-windows-gnu/release" "-L" "/home/frederick/rust/curl_example/target/x86_64-pc-windows-gnu/release/deps" "-L" "/home/frederick/rust/curl_example/target/x86_64-pc-windows-gnu/release/build/curl-sys-b582fd2220a1331e/out/lib" "-L" "/usr/local/lib/rustlib/x86_64-pc-windows-gnu/lib" "-L" "/home/frederick/rust/curl_example/.rust/lib/x86_64-pc-windows-gnu" "-L" "/home/frederick/rust/curl_example/lib/x86_64-pc-windows-gnu" "-Wl,-Bstatic" "-Wl,-Bdynamic" "-l" "ws2_32" "-l" "z" "-l" "ws2_32" "-l" "userenv" "-l" "advapi32" "-l" "compiler-rt"
    note: /home/frederick/rust/curl_example/target/x86_64-pc-windows-gnu/release/deps/libcurl_sys-b582fd2220a1331e.rlib(r-curl-libcurl_la-version.o): could not read symbols: Invalid operation
    collect2: error: ld returned 1 exit status
    
    error: aborting due to previous error
    Could not compile `curl_example`.
    
    Caused by:
      Process didn't exit successfully: `rustc src/main.rs --crate-name curl_example --crate-type bin -C opt-level=3 --out-dir /home/frederick/rust/curl_example/target/x86_64-pc-windows-gnu/release --emit=dep-info,link --target x86_64-pc-windows-gnu -C ar=x86_64-w64-mingw32-ar -C linker=x86_64-w64-mingw32-gcc -L dependency=/home/frederick/rust/curl_example/target/x86_64-pc-windows-gnu/release -L dependency=/home/frederick/rust/curl_example/target/x86_64-pc-windows-gnu/release/deps --extern curl=/home/frederick/rust/curl_example/target/x86_64-pc-windows-gnu/release/deps/libcurl-8828a61714ae0eb4.rlib -L /home/frederick/rust/curl_example/target/x86_64-pc-windows-gnu/release/build/curl-sys-b582fd2220a1331e/out/lib` (exit code: 101)
    

    When building for arm-unknown-linux-gnueabihf, I got:

       Compiling curl_example v0.1.0 (file:///home/frederick/rust/curl_example)
         Running `rustc src/main.rs --crate-name curl_example --crate-type bin -C opt-level=3 --out-dir /home/frederick/rust/curl_example/target/arm-unknown-linux-gnueabihf/release --emit=dep-info,link --target arm-unknown-linux-gnueabihf -C ar=arm-linux-gnueabihf-ar -C linker=arm-linux-gnueabihf-gcc -L dependency=/home/frederick/rust/curl_example/target/arm-unknown-linux-gnueabihf/release -L dependency=/home/frederick/rust/curl_example/target/arm-unknown-linux-gnueabihf/release/deps --extern curl=/home/frederick/rust/curl_example/target/arm-unknown-linux-gnueabihf/release/deps/libcurl-8828a61714ae0eb4.rlib -L /home/frederick/rust/curl_example/target/arm-unknown-linux-gnueabihf/release/build/curl-sys-b582fd2220a1331e/out/lib -L native=/home/frederick/rust/curl_example/target/arm-unknown-linux-gnueabihf/release/build/openssl-sys-765ddf9de3c5179c/out`
    error: linking with `arm-linux-gnueabihf-gcc` failed: exit code: 1
    note: "arm-linux-gnueabihf-gcc" "-Wl,--as-needed" "-L" "/usr/local/lib/rustlib/arm-unknown-linux-gnueabihf/lib" "/home/frederick/rust/curl_example/target/arm-unknown-linux-gnueabihf/release/curl_example.o" "-o" "/home/frederick/rust/curl_example/target/arm-unknown-linux-gnueabihf/release/curl_example" "-Wl,--whole-archive" "-l" "morestack" "-Wl,--no-whole-archive" "-Wl,--gc-sections" "-pie" "-Wl,-O1" "-nodefaultlibs" "/home/frederick/rust/curl_example/target/arm-unknown-linux-gnueabihf/release/deps/libcurl-8828a61714ae0eb4.rlib" "/home/frederick/rust/curl_example/target/arm-unknown-linux-gnueabihf/release/deps/libcurl_sys-b582fd2220a1331e.rlib" "/home/frederick/rust/curl_example/target/arm-unknown-linux-gnueabihf/release/deps/liburl-5247f81b4a7b5841.rlib" "/home/frederick/rust/curl_example/target/arm-unknown-linux-gnueabihf/release/deps/libmatches-68291f81832fc22d.rlib" "/home/frederick/rust/curl_example/target/arm-unknown-linux-gnueabihf/release/deps/liblog-8a6aba167994951e.rlib" "/home/frederick/rust/curl_example/target/arm-unknown-linux-gnueabihf/release/deps/liblibz_sys-e8e1552876cd3abe.rlib" "/home/frederick/rust/curl_example/target/arm-unknown-linux-gnueabihf/release/deps/librustc_serialize-7ff5bfc027146194.rlib" "/home/frederick/rust/curl_example/target/arm-unknown-linux-gnueabihf/release/deps/libopenssl_sys-765ddf9de3c5179c.rlib" "/home/frederick/rust/curl_example/target/arm-unknown-linux-gnueabihf/release/deps/liblibc-144c435538abd757.rlib" "/usr/local/lib/rustlib/arm-unknown-linux-gnueabihf/lib/libstd-d8ace771.rlib" "/usr/local/lib/rustlib/arm-unknown-linux-gnueabihf/lib/libcollections-d8ace771.rlib" "/usr/local/lib/rustlib/arm-unknown-linux-gnueabihf/lib/librustc_unicode-d8ace771.rlib" "/usr/local/lib/rustlib/arm-unknown-linux-gnueabihf/lib/librand-d8ace771.rlib" "/usr/local/lib/rustlib/arm-unknown-linux-gnueabihf/lib/liballoc-d8ace771.rlib" "/usr/local/lib/rustlib/arm-unknown-linux-gnueabihf/lib/liblibc-d8ace771.rlib" "/usr/local/lib/rustlib/arm-unknown-linux-gnueabihf/lib/libcore-d8ace771.rlib" "-L" "/home/frederick/rust/curl_example/target/arm-unknown-linux-gnueabihf/release" "-L" "/home/frederick/rust/curl_example/target/arm-unknown-linux-gnueabihf/release/deps" "-L" "/home/frederick/rust/curl_example/target/arm-unknown-linux-gnueabihf/release/build/curl-sys-b582fd2220a1331e/out/lib" "-L" "/home/frederick/rust/curl_example/target/arm-unknown-linux-gnueabihf/release/build/openssl-sys-765ddf9de3c5179c/out" "-L" "/usr/local/lib/rustlib/arm-unknown-linux-gnueabihf/lib" "-L" "/home/frederick/rust/curl_example/.rust/lib/arm-unknown-linux-gnueabihf" "-L" "/home/frederick/rust/curl_example/lib/arm-unknown-linux-gnueabihf" "-Wl,-Bstatic" "-Wl,-Bdynamic" "-l" "z" "-l" "crypto" "-l" "ssl" "-l" "c" "-l" "m" "-l" "dl" "-l" "pthread" "-l" "rt" "-l" "gcc_s" "-l" "pthread" "-l" "c" "-l" "m" "-l" "compiler-rt"
    note: /home/frederick/rust/curl_example/target/arm-unknown-linux-gnueabihf/release/curl_example.o: In function `main::h3f0c65dd085aa280gaa':
    curl_example.0.rs:(.text._ZN4main20h3f0c65dd085aa280gaaE+0x188): undefined reference to `curl_easy_setopt'
    /home/frederick/rust/curl_example/target/arm-unknown-linux-gnueabihf/release/deps/libcurl-8828a61714ae0eb4.rlib(curl-8828a61714ae0eb4.o): In function `ffi::easy::global_init::cleanup::hfb9c781cea2b575dzia':
    curl.0.rs:(.text._ZN3ffi4easy11global_init7cleanup20hfb9c781cea2b575dziaE+0x0): undefined reference to `curl_global_cleanup'
    /home/frederick/rust/curl_example/target/arm-unknown-linux-gnueabihf/release/deps/libcurl-8828a61714ae0eb4.rlib(curl-8828a61714ae0eb4.o): In function `ffi::easy::Easy.Drop::drop::h0c646593d425c9d3Hia':
    curl.0.rs:(.text._ZN3ffi4easy9Easy.Drop4drop20h0c646593d425c9d3HiaE+0x4): undefined reference to `curl_easy_cleanup'
    /home/frederick/rust/curl_example/target/arm-unknown-linux-gnueabihf/release/deps/libcurl-8828a61714ae0eb4.rlib(curl-8828a61714ae0eb4.o): In function `ffi::err::ErrCode.fmt..Display::fmt::h032b81c4990a5e2fOra':
    curl.0.rs:(.text._ZN3ffi3err20ErrCode.fmt..Display3fmt20h032b81c4990a5e2fOraE+0x48): undefined reference to `curl_easy_strerror'
    /home/frederick/rust/curl_example/target/arm-unknown-linux-gnueabihf/release/deps/libcurl-8828a61714ae0eb4.rlib(curl-8828a61714ae0eb4.o): In function `http::handle::Handle::new::hcbd4647fea69f7fe3Va':
    curl.0.rs:(.text._ZN4http6handle6Handle3new20hcbd4647fea69f7fe3VaE+0x220): undefined reference to `curl_easy_init'
    curl.0.rs:(.text._ZN4http6handle6Handle3new20hcbd4647fea69f7fe3VaE+0x230): undefined reference to `curl_easy_setopt'
    curl.0.rs:(.text._ZN4http6handle6Handle3new20hcbd4647fea69f7fe3VaE+0x244): undefined reference to `curl_easy_setopt'
    curl.0.rs:(.text._ZN4http6handle6Handle3new20hcbd4647fea69f7fe3VaE+0x260): undefined reference to `curl_easy_setopt'
    curl.0.rs:(.text._ZN4http6handle6Handle3new20hcbd4647fea69f7fe3VaE+0x49c): undefined reference to `curl_easy_cleanup'
    curl.0.rs:(.text._ZN4http6handle6Handle3new20hcbd4647fea69f7fe3VaE+0x534): undefined reference to `curl_easy_cleanup'
    curl.0.rs:(.text._ZN4http6handle6Handle3new20hcbd4647fea69f7fe3VaE+0x558): undefined reference to `curl_easy_cleanup'
    curl.0.rs:(.text._ZN4http6handle6Handle3new20hcbd4647fea69f7fe3VaE+0x5dc): undefined reference to `curl_easy_cleanup'
    /home/frederick/rust/curl_example/target/arm-unknown-linux-gnueabihf/release/deps/libcurl-8828a61714ae0eb4.rlib(curl-8828a61714ae0eb4.o): In function `ffi::easy::Easy::setopt::h17415893674049649907':
    curl.0.rs:(.text._ZN3ffi4easy4Easy6setopt21h17415893674049649907E+0x1bc): undefined reference to `curl_easy_setopt'
    /home/frederick/rust/curl_example/target/arm-unknown-linux-gnueabihf/release/deps/libcurl-8828a61714ae0eb4.rlib(curl-8828a61714ae0eb4.o): In function `http::handle::Request$LT$$u27$a$C$$u20$$u27$b$GT$::exec::hd3fad3894ea8584cgab':
    curl.0.rs:(.text._ZN4http6handle35Request$LT$$u27$a$C$$u20$$u27$b$GT$4exec20hd3fad3894ea8584cgabE+0x108): undefined reference to `curl_easy_setopt'
    curl.0.rs:(.text._ZN4http6handle35Request$LT$$u27$a$C$$u20$$u27$b$GT$4exec20hd3fad3894ea8584cgabE+0x14c): undefined reference to `curl_easy_setopt'
    curl.0.rs:(.text._ZN4http6handle35Request$LT$$u27$a$C$$u20$$u27$b$GT$4exec20hd3fad3894ea8584cgabE+0x1a0): undefined reference to `curl_easy_setopt'
    curl.0.rs:(.text._ZN4http6handle35Request$LT$$u27$a$C$$u20$$u27$b$GT$4exec20hd3fad3894ea8584cgabE+0x1b8): undefined reference to `curl_easy_setopt'
    /home/frederick/rust/curl_example/target/arm-unknown-linux-gnueabihf/release/deps/libcurl-8828a61714ae0eb4.rlib(curl-8828a61714ae0eb4.o):curl.0.rs:(.text._ZN4http6handle35Request$LT$$u27$a$C$$u20$$u27$b$GT$4exec20hd3fad3894ea8584cgabE+0x1d0): more undefined references to `curl_easy_setopt' follow
    /home/frederick/rust/curl_example/target/arm-unknown-linux-gnueabihf/release/deps/libcurl-8828a61714ae0eb4.rlib(curl-8828a61714ae0eb4.o): In function `http::handle::Request$LT$$u27$a$C$$u20$$u27$b$GT$::exec::hd3fad3894ea8584cgab':
    curl.0.rs:(.text._ZN4http6handle35Request$LT$$u27$a$C$$u20$$u27$b$GT$4exec20hd3fad3894ea8584cgabE+0x8e4): undefined reference to `curl_slist_append'
    curl.0.rs:(.text._ZN4http6handle35Request$LT$$u27$a$C$$u20$$u27$b$GT$4exec20hd3fad3894ea8584cgabE+0x94c): undefined reference to `curl_easy_setopt'
    curl.0.rs:(.text._ZN4http6handle35Request$LT$$u27$a$C$$u20$$u27$b$GT$4exec20hd3fad3894ea8584cgabE+0x998): undefined reference to `curl_slist_free_all'
    curl.0.rs:(.text._ZN4http6handle35Request$LT$$u27$a$C$$u20$$u27$b$GT$4exec20hd3fad3894ea8584cgabE+0xa30): undefined reference to `curl_easy_setopt'
    curl.0.rs:(.text._ZN4http6handle35Request$LT$$u27$a$C$$u20$$u27$b$GT$4exec20hd3fad3894ea8584cgabE+0xa50): undefined reference to `curl_easy_setopt'
    curl.0.rs:(.text._ZN4http6handle35Request$LT$$u27$a$C$$u20$$u27$b$GT$4exec20hd3fad3894ea8584cgabE+0xa70): undefined reference to `curl_easy_setopt'
    curl.0.rs:(.text._ZN4http6handle35Request$LT$$u27$a$C$$u20$$u27$b$GT$4exec20hd3fad3894ea8584cgabE+0xa84): undefined reference to `curl_easy_setopt'
    curl.0.rs:(.text._ZN4http6handle35Request$LT$$u27$a$C$$u20$$u27$b$GT$4exec20hd3fad3894ea8584cgabE+0xaa4): undefined reference to `curl_easy_setopt'
    /home/frederick/rust/curl_example/target/arm-unknown-linux-gnueabihf/release/deps/libcurl-8828a61714ae0eb4.rlib(curl-8828a61714ae0eb4.o):curl.0.rs:(.text._ZN4http6handle35Request$LT$$u27$a$C$$u20$$u27$b$GT$4exec20hd3fad3894ea8584cgabE+0xabc): more undefined references to `curl_easy_setopt' follow
    /home/frederick/rust/curl_example/target/arm-unknown-linux-gnueabihf/release/deps/libcurl-8828a61714ae0eb4.rlib(curl-8828a61714ae0eb4.o): In function `http::handle::Request$LT$$u27$a$C$$u20$$u27$b$GT$::exec::hd3fad3894ea8584cgab':
    curl.0.rs:(.text._ZN4http6handle35Request$LT$$u27$a$C$$u20$$u27$b$GT$4exec20hd3fad3894ea8584cgabE+0xaf8): undefined reference to `curl_easy_perform'
    curl.0.rs:(.text._ZN4http6handle35Request$LT$$u27$a$C$$u20$$u27$b$GT$4exec20hd3fad3894ea8584cgabE+0xb30): undefined reference to `curl_easy_getinfo'
    curl.0.rs:(.text._ZN4http6handle35Request$LT$$u27$a$C$$u20$$u27$b$GT$4exec20hd3fad3894ea8584cgabE+0xc0c): undefined reference to `curl_slist_free_all'
    curl.0.rs:(.text._ZN4http6handle35Request$LT$$u27$a$C$$u20$$u27$b$GT$4exec20hd3fad3894ea8584cgabE+0xe24): undefined reference to `curl_slist_free_all'
    /home/frederick/rust/curl_example/target/arm-unknown-linux-gnueabihf/release/deps/libcurl-8828a61714ae0eb4.rlib(curl-8828a61714ae0eb4.o): In function `ffi::easy::Easy::setopt::h1335928551378549339':
    curl.0.rs:(.text._ZN3ffi4easy4Easy6setopt20h1335928551378549339E+0x160): undefined reference to `curl_easy_setopt'
    collect2: error: ld returned 1 exit status
    
    error: aborting due to previous error
    Could not compile `curl_example`.
    
    Caused by:
      Process didn't exit successfully: `rustc src/main.rs --crate-name curl_example --crate-type bin -C opt-level=3 --out-dir /home/frederick/rust/curl_example/target/arm-unknown-linux-gnueabihf/release --emit=dep-info,link --target arm-unknown-linux-gnueabihf -C ar=arm-linux-gnueabihf-ar -C linker=arm-linux-gnueabihf-gcc -L dependency=/home/frederick/rust/curl_example/target/arm-unknown-linux-gnueabihf/release -L dependency=/home/frederick/rust/curl_example/target/arm-unknown-linux-gnueabihf/release/deps --extern curl=/home/frederick/rust/curl_example/target/arm-unknown-linux-gnueabihf/release/deps/libcurl-8828a61714ae0eb4.rlib -L /home/frederick/rust/curl_example/target/arm-unknown-linux-gnueabihf/release/build/curl-sys-b582fd2220a1331e/out/lib -L native=/home/frederick/rust/curl_example/target/arm-unknown-linux-gnueabihf/release/build/openssl-sys-765ddf9de3c5179c/out` (exit code: 101)
    

    But I did successfully cross-compile curl-rust itself for both x86_64-pc-windows-gnu and arm-unknown-linux-gnueabihf which made it weirder.

    How to fix these problems? Did I miss any configurations?

    opened by Frederick888 13
  • Expose the curl_multi_poll & curl_multi_wakeup APIs

    Expose the curl_multi_poll & curl_multi_wakeup APIs

    Currently, the curl crate uses internally the older curl_multi_wait API for classic poll(2)-based async clients.

    It would be quite useful, if we could use the newer curl_multi_poll API instead (or let the user decide).

    I have an application that does a lot of HTTP PUTs where the source that produces the data gets quite slow occasionally. When curl asks for data, but we don't have anything to send yet, my read_function returns Err(ReadError::Pause) and at some point in the future, I can resume the transfer with unpause_read(), however, there could be up to a second delay between the moment more data is available and the moment the transfer is unpaused. IIRC, curl_multi_poll/wakeup solve this problem precisely while having the extra benefit that curl_multi_wakeup can be invoked in any thread (nice!).

    Are there any plans to expose these functions? If I attempted to do the work myself, what additional steps do I need to take in terms of documentation, unit tests, etc?

    enhancement 
    opened by darkprokoba 12
  • Latest version causes Multi::wait to block and ignore socket events

    Latest version causes Multi::wait to block and ignore socket events

    Since commit 7f0f5dad2458313e2800cf915c55f180184f6617, using Multi::wait() together with Multi::get_timeout() produces very strange results when combined with one or more extra WaitFds passed to wait().

    I'm seeing two strange behaviors:

    First scenario: When get_timeout() returns Ok(None), my understanding is that curl doesn't have enough info to specify an appropriate timeout value and I should pick a reasonable default. I pick 1s in this case.

    When this happens, for some reason, calling wait() with the default timeout causes curl to block forever until the given timeout is reached, even if there is socket activity on one or more easy handles, or on an extra fd.

    Below is an example program that reproduces the problem:

    extern crate curl;
    
    struct Handler;
    
    impl curl::easy::Handler for Handler {}
    
    fn main() -> Result<(), Box<std::error::Error>> {
        let mut easy = curl::easy::Easy2::new(Handler);
        easy.verbose(true)?;
        easy.get(true)?;
        easy.url("http://example.org")?;
    
        let multi = curl::multi::Multi::new();
        let _easy = multi.add2(easy)?;
    
        let mut extra_fds = [curl::multi::WaitFd::new()];
        extra_fds[0].set_fd(0);
        extra_fds[0].poll_on_read(true);
    
        while multi.perform()? > 0 {
            let timeout = multi.get_timeout()?.unwrap_or(std::time::Duration::from_secs(100));
            println!("timeout: {:?}", timeout);
            multi.wait(&mut extra_fds, timeout)?;
        }
    
        Ok(())
    }
    

    Second scenario: In this scenario, curl does return a recommended timeout, but is a very large number, such as 300 seconds. Normally this would be fine, but similar to the first scenario, curl blocks for the full timeout duration, even when there is socket activity that should interrupt it.

    I'm still working on extracting an example from my code that reproduces this.

    I'm not sure if upgrading the version of curl being used caused this problem and it is an upstream bug, or changing how curl is compiled introduced this issue. I've done some digging myself, but hopefully someone else with more knowledge might have a better idea of the cause.

    My unproven theory is that somehow the latest change causes curl to use a really poor implementation for curl_multi_wait().

    Tested on Linux.

    opened by sagebind 12
  • if openssl dlls are loaded, populate the openssl cert store from the windows cert store

    if openssl dlls are loaded, populate the openssl cert store from the windows cert store

    This is a first cut of pulling certificates from the windows cert store into openssl as discussed in https://github.com/alexcrichton/curl-rust/pull/185. It works, but only for dynamically linked builds since the required APIs are not accessible in a static build.

    The appveyor build was previously a target-feature=+crt-static static build. I obviously had not run the systests with a DLL build - they fail with lots of these:

    bad curl_formadd function pointer: rust: 140700645719848 (0x7ff76c01ff28) != c 140719549205408 (0x7ffbd2be4ba0)
    

    (from https://ci.appveyor.com/project/mcgoo/curl-rust/build/job/ee7opiuiayrniykq)

    Any thoughts on what would cause that and how to chase it down?

    cc: @sfackler

    opened by mcgoo 12
  • use openssl-probe to look for root certificates on windows also

    use openssl-probe to look for root certificates on windows also

    This makes Easy2 use openssl-probe on Windows also. (Vcpkg by default builds a libcurl that uses OpenSSL.)

    I verified that the libcurl built into curl-sys still works if the SSL_CERT_FILE environment variable is set.

    This fixes this test failure on appveyor: https://ci.appveyor.com/project/alexcrichton/curl-rust/build/job/3v6g79vc3htcrm5t

    opened by mcgoo 12
  • add impersonate-chrome and impersonate-ff features (#482)

    add impersonate-chrome and impersonate-ff features (#482)

    initial support for curl-impersonate. allows linking with system-provided libcurl-impersonate-chrome or libcurl-impersonate-ff instead of libcurl. doesn't allow to choose the impersonation target within the code (see #482 for further goals), but the CURL_IMPERSONATE env variable passed to the binary is respected by the library.

    opened by selfisekai 0
  • curl-impersonate support

    curl-impersonate support

    https://github.com/lwthiker/curl-impersonate

    curl-impersonate allows to fight with TLS fingerprinting, a technique used to prevent scraping (here's an example offering from Cloudflare: https://developers.cloudflare.com/bots/concepts/ja3-fingerprint).

    I think supporting it here boils down this:

    • [ ] add impersonate-chrome and impersonate-ff optional features, changing the searched library config to libcurl-impersonate-chrome and libcurl-impersonate-ff respectively (#483)
    • [ ] add support for static-curl feature with impersonate features (using curl-impersonate instead of upstream; not necessarily needed)
    • [ ] expose curl_easy_impersonate in curl-sys crate (limited to impersonate features; docs: https://github.com/lwthiker/curl-impersonate#advanced-usage)
    • [ ] expose curl-impersonate specific opts (on impersonate features)
    • [ ] re-expose curl_easy_impersonate in curl::easy::Easy2 (and curl::easy::Easy?)
    opened by selfisekai 0
  • Vendor libgss when static-curl and spnego features are set

    Vendor libgss when static-curl and spnego features are set

    For spnego authentication to work, curl needs to be built with "a suitable GSS-API library or SSPI on Windows" [0].

    Right now, the build fails if static-curl and spnego features are set, and no suitable lib is found. What do you think of vendoring this dependency in this case?

    This is for proxy authentication support in cargo: https://github.com/rust-lang/cargo/issues/7330 https://github.com/rust-lang/cargo/pull/11433

    [0] https://docs.rs/curl/0.4/curl/easy/struct.Auth.html#method.gssnegotiate

    opened by hhirtz 0
  • I cannot find CURLAUTH_ANY for Auto Authentication

    I cannot find CURLAUTH_ANY for Auto Authentication

    Hello

    I need to call a method in the Auth structure that will set a CURLAUTH_ANY for curl but I didn't find one. Please enlighten me where to get a method can sets CURLAUTH_ANY for Auto authentication.

    Best Regards,

    Lorenzo

    opened by LorenzoLeonardo 0
Releases(0.4.44)
  • 0.4.44(Jul 22, 2022)

  • 0.4.43(Mar 12, 2022)

    Added

    • Expose DNS-over-HTTP options on Easy and Easy2 in curl. Also add relevant definitions for DOH options to curl-sys. (#434)

    Fixed

    • Fix error attempting to mistakenly link to "/lib/darwin" on some macOS configurations where clang --print-search-dirs returns an empty result. (#435)

    Changed

    • Support for MesaLink has been removed from curl upstream. The mesalink feature in both the curl and curl-sys crates now no longer link to MesaLink and emit a warning at build-time, instead falling back to the default TLS backend.
    • Upgraded bundled curl version in curl-sys to 7.82.0 (#438)
    Source code(tar.gz)
    Source code(zip)
  • 0.4.42(Jan 8, 2022)

    Added

    • Add ability to compile bundled curl with rustls as the TLS engine with the rustls crate feature. (#341, #374)
    • Allow enabling NLTM support when compiling bundled curl with the nltm crate feature. (#428)
    • Added more complex example program for using multi API. (#431)

    Changed

    • Upgraded bundled curl version in curl-sys to 7.81.0 (#432)
    Source code(tar.gz)
    Source code(zip)
  • 0.4.41(Nov 20, 2021)

    Added

    Fixed

    • Refactored init behavior to avoid being affected by rustc linking issue https://github.com/rust-lang/rust/issues/90342 on macOS 12.0 Monterey (#417, #426)
    • Guarantee that curl_multi_remove_handle is always called on easy handles attached to a multi handle before being closed. This avoids triggering a double-free bug present in curl 7.78.0-7.80.0. (#421, #423)

    Changed

    • Upgraded bundled curl version in curl-sys to 7.80.0 (#422)
    Source code(tar.gz)
    Source code(zip)
  • 0.4.37(May 13, 2021)

  • 0.4.36(Apr 17, 2021)

    Added

    • Add support for in-memory certificates via new _BLOB options. (#384)

    Dependency updates

    • Update bundled curl to 7.76.0. (#383)
    • Update socket2 to 0.4.0. (#382)
    Source code(tar.gz)
    Source code(zip)
  • 0.4.35(Mar 9, 2021)

    Added

    • Add some more fields to Debug for Version (#368)
    • Add expect_100_timeout option to mirror CURLOPT_EXPECT_100_TIMEOUT_MS (#376)
    • Add feature-gated support for curl_easy_upkeep, introduced in 7.62.0. Use the upkeep_7_62_0 feature to enable this method. (#378)

    Fixed

    • Probe for OpenSSL certificates only once (#362, #363)
    • Upgrade socket2 dependency to a version not making invalid assumptions about the memory layout of std::net::SocketAddr. (#365)
    • Fix debug formatting for Events struct (#377)
    • Fix tcp_nodelay not working for static builds on Unix (#379, #381)
    Source code(tar.gz)
    Source code(zip)
  • 0.4.34(Oct 14, 2020)

    Added

    Fixed

    • Fix Easy2::fmt to print handler correctly. (#353)
    • Fix the bug that cvt() could get rid of extra error message. (#355)
    • Fix some Clippy warnings (#356)

    Dependencies

    • Bump curl to 7.72.0 (#354)
    Source code(tar.gz)
    Source code(zip)
  • 0.4.33(Oct 14, 2020)

  • 0.4.32(Oct 14, 2020)

  • 0.4.31(Jul 23, 2020)

    Added

    • Add proxy_cacert, which completes the bindings for proxy SSL options. (#160, #344)
    • Update bundled libcurl build configuration to enable support for Unix sockets automatically on Unix platforms. (#297, #309, #346)
    • Add unix_socket_path that exposes more Unix socket control than the existing unix_socket method. (#347)
    • Expose CURLOPT_CONNECT_TO via connect_to, which allows you to override the socket address that requests are made to. (#348)

    Dependencies

    • Bump bundled libcurl version to 7.71.1. (#343, #345)
    Source code(tar.gz)
    Source code(zip)
  • 0.4.30(Jun 24, 2020)

    Fixed

    • Fix a safety hole in Multi::close and hide it from docs. This method previously would free the underlying CURLM pointer without consuming the Multi struct, making it possible to cause a use-after-free in safe code. This function now simply returns Ok(()) in order to maintain backwards compatibility, but will be either changed or removed in a future breaking release. (#340, #342)

    Added

    • Add bindings for setting SSL/TLS options for proxies: proxy_cainfo, proxy_sslcert, and proxy_sslkey. (#339)
    • Add HttpVersion::V3 to accomodate for future HTTP/3 support. (#331)

    Changed

    • Mitigate a race condition that can occur when libcurl is first initialized with certain TLS engine versions on a thread other than the main thread by attempting to initialize in a constructor function automatically. This should reduce the likelihood of the misuse occurring on most targets. (#333, #334)
    Source code(tar.gz)
    Source code(zip)
Owner
Alex Crichton
Alex Crichton
Typed, correct GraphQL requests and responses in Rust

graphql_client A typed GraphQL client library for Rust. Features Precise types for query variables and responses. Supports GraphQL fragments, objects,

GraphQL Rust 914 Dec 27, 2022
An HTTP library for Rust

hyper A fast and correct HTTP implementation for Rust. HTTP/1 and HTTP/2 Asynchronous design Leading in performance Tested and correct Extensive produ

null 11k Jan 8, 2023
An easy and powerful Rust HTTP Client

reqwest An ergonomic, batteries-included HTTP Client for Rust. Plain bodies, JSON, urlencoded, multipart Customizable redirect policy HTTP Proxies HTT

Sean McArthur 6.8k Dec 31, 2022
FeignHttp is a declarative HTTP client. Based on rust macros.

FeignHttp is a declarative HTTP client. Based on rust macros. Features Easy to use Asynchronous request Configurable timeout settings Suppor

null 46 Nov 30, 2022
Pretend is a macros-based declarative Rust HTTP client

pretend is a modular, Feign-inspired HTTP, client based on macros. It's goal is to decouple the definition of a REST API from it's implementation.

null 24 Aug 3, 2022
Pyre - A fast python HTTP server inspired by japronto written in rust.

Pyre - A fast python HTTP server inspired by japronto written in rust.

null 135 Nov 26, 2022
A rule34 scraper made in rust this time

rust-34-scraper A rule34 scraper made in rust this time Building Clone the repository Execute cargo build --release --release is an optimized build pr

null 3 Jun 10, 2022
Minimal Rust HTTP client for both native and WASM

ehttp: a minimal Rust HTTP client for both native and WASM If you want to do HTTP requests and are targetting both native and web (WASM), then this is

Emil Ernerfeldt 105 Dec 25, 2022
Fast and friendly HTTP server framework for async Rust

Tide Serve the web API Docs | Contributing | Chat Tide is a minimal and pragmatic Rust web application framework built for rapid development. It comes

http-rs 4.1k Jan 2, 2023
ratpack: a simpleton's HTTP framework (for rust-lang)

ratpack: a simpleton's HTTP framework (for rust-lang) ratpack is idealized in the simplicity of the sinatra (ruby) framework in its goal, and attempts

ZeroTier, Inc. 5 Jun 29, 2022
A backend providing a HTTP REST like interface for uploading files written in rust.

UploadServer A backend providing a HTTP REST like interface for uploading files written in rust. API Documentation License This project is licensed un

null 4 Nov 20, 2022
Rust bindings to libcurl

curl-rust libcurl bindings for Rust Quick Start use std::io::{stdout, Write}; use curl::easy::Easy; // Print a web page onto stdout fn main() {

Alex Crichton 885 Jan 9, 2023
A curl(libcurl) mod for rust.

curl Master Dev A lightweight Curl-wrapper for using (mostly) HTTP from Rust. While there are a couple of Rust HTTP libraries like rust-http and its s

Valerii Hiora 2 Sep 14, 2016
HTTP client/libcurl TUI front end in Rust, with request + key storage

Rust TUI HTTP Client with API Key Management This project is still in active development and although it is useable, there may still be bugs and signi

Preston Thorpe 23 Nov 9, 2023
An esoteric language/compiler written with Rust and Rust LLVM bindings

MeidoLang (メイドラング) A not so useful and esoteric language. The goal of this project was to contain some quirky or novel syntax in a stack-style program

null 0 Dec 24, 2021
Rust based WASM/JS bindings for ur-rust

ur-wasm-js WASM/JS bindings for the ur-rust rust library Getting started Installation Either build the library yourself with wasm-pack or install for

Lightning Digital Entertainment 5 Feb 28, 2024
Rust bindings for libinjection

libinjection-rs Rust bindings for libinjection. How to use Add libinjection to dependencies of Cargo.toml: libinjection = "0.2" Import crate: extern c

ArvanCloud 35 Sep 24, 2022
A project for generating C bindings from Rust code

cbindgen   Read the full user docs here! cbindgen creates C/C++11 headers for Rust libraries which expose a public C API. While you could do this by h

Ryan Hunt 1.7k Jan 3, 2023
Automatically generates Rust FFI bindings to C (and some C++) libraries.

bindgen bindgen automatically generates Rust FFI bindings to C (and some C++) libraries. For example, given the C header doggo.h: typedef struct Doggo

The Rust Programming Language 3.2k Jan 4, 2023
Rust-JDBC bindings

jdbc A Rust library that allows you to use JDBC and JDBC drivers. Usage First, add the following to your Cargo.toml: [dependencies] jdbc = "0.1" Next,

Aurora 18 Feb 9, 2022