Rust bindings for libssh2

Overview

ssh2-rs

Build Status Build Status Build Status

Documentation

Rust bindings to libssh2, an ssh client library.

Usage

# Cargo.toml
[dependencies]
ssh2 = "0.9"

Building on OSX 10.10+

This library depends on OpenSSL. To get OpenSSL working follow the openssl crate's instructions.

Starting with version 0.4 of ssh2, you can enable the vendored-openssl feature to have libssh2 built against a statically built version of openssl as described here

License

This project is licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this project by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Comments
  • Session::handshake is a footgun

    Session::handshake is a footgun

    So Session::handshake takes a &TcpStream, and has a note saying that the user has to make sure the socket lives long enough. This isn't particularly obvious and can lead to the socket being closed prematurely.

    Session should probably take ownership of the stream and handle closing it in it's destructor. If that's not suitable, some clever use PhantomData and lifetimes should provide some protection.

    This issue was triggered by a user on IRC being stung by this problem.

    opened by Aatch 28
  • Could NOT find ZLIB

    Could NOT find ZLIB

    Hi! When I try to build cargo on Windows as a library for my program libssh2-rs fails to build with the following error:

    toolchain: stable-x86_64-pc-windows-gnu rustc-version: rustc 1.15.1 (021bd294c 2017-02-08) OS: Windows 7 64bit Msys64 installed

    error: failed to run custom build command for libssh2-sys v0.2.5 process didn't exit successfully: E:\development\cargo-authors\target\debug\build\libssh2-sys-04373e2a6b69259d\build-script-build (exit code: 101) --- stdout running: "cmake" "C:\Users\***\.cargo\registry\src\github.com-1ecc6299db9ec823\libssh2-sys-0.2.5\libssh2" "-G" "MSYS Makefiles" "-DCRYPTO_BACKEND=WinCNG" "-DZLIB_INCLUDE_DIR=E:\development\cargo-authors\target\debug\build\libz-sys-c29f5c61ff9da9c5\out/include" "-DBUILD_SHARED_LIBS=OFF" "-DENABLE_ZLIB_COMPRESSION=ON" "-DCMAKE_INSTALL_LIBDIR=lib" "-DBUILD_EXAMPLES=OFF" "-DBUILD_TESTING=OFF" "-DCMAKE_INSTALL_PREFIX=E:\development\cargo-authors\target\debug\build\libssh2-sys-9b7d67f8c921632b\out" "-DCMAKE_C_FLAGS= -ffunction-sections -fdata-sections -m64" "-DCMAKE_CXX_FLAGS= -ffunction-sections -fdata-sections -m64" "-DCMAKE_BUILD_TYPE=Debug" -- The C compiler identification is GNU 6.3.0 -- Check for working C compiler: C:/msys64/usr/bin/gcc.exe -- Check for working C compiler: C:/msys64/usr/bin/gcc.exe -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Looking for include files windows.h, bcrypt.h -- Looking for include files windows.h, bcrypt.h - found -- Looking for include file ntdef.h -- Looking for include file ntdef.h - found -- Looking for include file ntstatus.h -- Looking for include file ntstatus.h - found -- Looking for include files windows.h, wincrypt.h -- Looking for include files windows.h, wincrypt.h - found -- Configuring incomplete, errors occurred! See also "E:/Development/cargo-authors/target/debug/build/libssh2-sys-9b7d67f8c921632b/out/build/CMakeFiles/CMakeOutput. log".

    --- stderr fatal: Not a git repository (or any of the parent directories): .git CMake Error at C:/Program Files/CMake/share/cmake-3.7/Modules/FindPackageHandleStandardArgs.cmake:138 (message): Could NOT find ZLIB (missing: ZLIB_LIBRARY) (found version "1.2.8") Call Stack (most recent call first): C:/Program Files/CMake/share/cmake-3.7/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE) C:/Program Files/CMake/share/cmake-3.7/Modules/FindZLIB.cmake:114 (FIND_PACKAGE_HANDLE_STANDARD_ARGS) src/CMakeLists.txt:239 (find_package)

    thread 'main' panicked at ' command did not execute successfully, got: exit code: 1

    build script failed, must exit now', C:\Users***.cargo\registry\src\github.com-1ecc6299db9ec823\cmake-0.1.20\src\lib.rs:573

    opened by Henning-K 15
  • Add LIBSSH2_SYS_USE_PKG_CONFIG env var

    Add LIBSSH2_SYS_USE_PKG_CONFIG env var

    The latest actual release of libssh2 is old and broken. This uses the submodule instead unless you set LIBSSH2_SYS_USE_PKG_CONFIG. The mechanism is copied from libgit2.

    I haven't tested this, because I don't know how to get cargo to build everything with these changes. :-/

    opened by Timmmm 13
  • Use a larger buffer for readdir

    Use a larger buffer for readdir

    The libssh2 C API skips entries if the buffer is not big enough, so the previous strategy of retrying with a larger buffer on error will actually cause some files to be skipped.

    Fixes #217

    opened by sourcefrog 12
  • 0.2.16 causes build to fail on Debian/sid

    0.2.16 causes build to fail on Debian/sid

    Forcing 0.2.15 as dependency makes it work again.

    What happens is that at link-time, the following error (example: cargo-outdated) happens:

    error: linking with `cc` failed: exit code: 1
      |
      = note: "cc" "-Wl,--as-needed" "-Wl,-z,noexecstack" "-m64" "-L" "/home/slomo/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "/tmp/cargo-installybkdsp/release/deps/cargo_outdated-1ea77f6eb6917f05.cargo_outdated.6ksrfsse-cgu.15.rcgu.o" "-o" "/tmp/cargo-installybkdsp/release/deps/cargo_outdated-1ea77f6eb6917f05" "-Wl,--gc-sections" "-pie" "-Wl,-zrelro" "-Wl,-znow" "-Wl,-O1" "-nodefaultlibs" "-L" "/tmp/cargo-installybkdsp/release/deps" "-L" "/usr/lib/x86_64-linux-gnu" "-L" "/tmp/cargo-installybkdsp/release/build/libnghttp2-sys-1df74163b8635c4a/out/i/lib" "-L" "/usr/lib/x86_64-linux-gnu" "-L" "/tmp/cargo-installybkdsp/release/build/backtrace-sys-21cc0c968ec9fc50/out" "-L" "/tmp/cargo-installybkdsp/release/build/libgit2-sys-9304318852370821/out/build" "-L" "/usr/lib/x86_64-linux-gnu" "-L" "/tmp/cargo-installybkdsp/release/build/libssh2-sys-f852cf8ccaa1fceb/out/build" "-L" "/home/slomo/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,-Bstatic" "/tmp/rustcZ7rwZW/liblibgit2_sys-0fe20175db1a82f4.rlib" "/tmp/rustcZ7rwZW/liblibssh2_sys-cf317a9056f6cde6.rlib" "/tmp/rustcZ7rwZW/libbacktrace_sys-9be9c43e32499755.rlib" "-Wl,--start-group" "/tmp/rustcZ7rwZW/libbacktrace_sys-32c2dc6fbc292c9c.rlib" "-Wl,--end-group" "/home/slomo/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-0b278345638bce90.rlib" "-Wl,-Bdynamic" "-lz" "-lssl" "-lcrypto" "-lz" "-lcurl" "-lutil" "-ldl" "-lutil" "-ldl" "-lrt" "-lpthread" "-lgcc_s" "-lc" "-lm" "-lrt" "-lpthread" "-lutil" "-lutil"
      = note: /usr/bin/ld: /tmp/rustcZ7rwZW/liblibssh2_sys-cf317a9056f6cde6.rlib(libgcrypt.o): undefined reference to symbol 'gcry_sexp_nth_data@@GCRYPT_1.6'
              /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libgcrypt.so.20: error adding symbols: DSO missing from command line
              collect2: error: ld returned 1 exit status
    

    Depending on the crate it's other symbols, but always something from libgcrypt.so.20. It seems like for some reason it got dropped from the linker commandline between 0.2.15 and 0.2.16.

    opened by sdroege 12
  • x86_64-pc-windows-msvc build fails

    x86_64-pc-windows-msvc build fails

    I'm trying to build on Windows 10, looks like problem with cmake. Any ideas how to solve?

    • cmake version 3.11.0-rc3
    • rustc 1.24.1 (d3ae9a9e0 2018-02-27)
    error: failed to run custom build command for `libssh2-sys v0.2.6`
    process didn't exit successfully: `Y:\ssh-permit-a38\target\release\build\libssh2-sys-e54262193525481a\build-script-build` (exit code: 101)
    --- stdout
    running: "cmake" "C:\\Users\\boerni\\.cargo\\registry\\src\\github.com-1ecc6299db9ec823\\libssh2-sys-0.2.6\\libssh2" "-G" "Visual Studio 15 2017 Win64" "-DCRYPTO_BACKEND=WinCNG" "-DZLIB_INCLUDE_DIR=Y:\\ssh-permit-a38\\target\\x86_64-pc-windows-msvc\\release\\build\\libz-sys-e3d4347320821748\\out/include" "-DBUILD_SHARED_LIBS=OFF" "-DENABLE_ZLIB_COMPRESSION=ON" "-DCMAKE_INSTALL_LIBDIR=lib" "-DBUILD_EXAMPLES=OFF" "-DBUILD_TESTING=OFF" "-DCMAKE_INSTALL_PREFIX=Y:\\ssh-permit-a38\\target\\x86_64-pc-windows-msvc\\release\\build\\libssh2-sys-34a0b1cb6fc34b56\\out" "-DCMAKE_C_FLAGS= /nologo /MD" "-DCMAKE_C_FLAGS_RELEASE= /nologo /MD" "-DCMAKE_CXX_FLAGS= /nologo /MD" "-DCMAKE_CXX_FLAGS_RELEASE= /nologo /MD" "-DCMAKE_BUILD_TYPE=Release"
    -- The C compiler identification is MSVC 19.13.26128.0
    -- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.13.26128/bin/Hostx86/x64/cl.exe
    -- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.13.26128/bin/Hostx86/x64/cl.exe -- works
    -- Detecting C compiler ABI info
    -- Detecting C compiler ABI info - done
    -- Looking for include files windows.h, bcrypt.h
    -- Looking for include files windows.h, bcrypt.h - not found
    -- Configuring incomplete, errors occurred!
    See also "Y:/ssh-permit-a38/target/x86_64-pc-windows-msvc/release/build/libssh2-sys-34a0b1cb6fc34b56/out/build/CMakeFiles/CMakeOutput.log".
    See also "Y:/ssh-permit-a38/target/x86_64-pc-windows-msvc/release/build/libssh2-sys-34a0b1cb6fc34b56/out/build/CMakeFiles/CMakeError.log".
    
    --- stderr
    fatal: Not a git repository (or any of the parent directories): .git
    CMake Error at src/CMakeLists.txt:149 (elseif):
      given arguments:
    
        "REQUIRED" "STREQUAL"
    
      Unknown arguments specified
    
    
    thread 'main' panicked at '
    command did not execute successfully, got: exit code: 1
    
    build script failed, must exit now', C:\Users\boerni\.cargo\registry\src\github.com-1ecc6299db9ec823\cmake-0.1.29\src\lib.rs:632:5
    note: Run with `RUST_BACKTRACE=1` for a backtrace.
    
    warning: build failed, waiting for other jobs to finish...
    error: build failed
    
    opened by ierror 12
  • Fail to build on Windows

    Fail to build on Windows

    Hi

    I am trying to build a binary which depends on ssh2-rs using cargo on Windows 7. I have msys64 installed and gcc 4.9.2-4.

    Are there some instructions available on how to build on windows?

    The error I get:

    Build failed, waiting for other jobs to finish...
    failed to run custom build command for `libssh2-sys v0.1.23`
    Process didn't exit successfully: `C:\<edit>\target\debug\build\libssh2-sys-235a8bd8d34c9dc8\build-script-build` (exit code: 101)
    --- stdout
    running: "make" "-fGNUmakefile" "WITH_WINCNG=1" "WITH_ZLIB=1" "lib"
    gcc -O2 -DNDEBUG -DLIBSSH2_WIN32  -fno-builtin -fno-strict-aliasing -Wall  -D_AMD64_ -DLIBSSH2_WINCNG -DLIBSSH2_HAVE_ZLIB -I../win32 -I../include -I../../zlib-1.2.8 -c ../src/channel.c -o release/channel.o
    GNUmakefile:232: recipe for target 'release/channel.o' failed
    
    --- stderr
    In file included from /usr/include/cygwin/sys_time.h:13:0,
                     from /usr/include/sys/time.h:61,
                     from /usr/include/sys/_default_fcntl.h:196,
                     from /usr/include/sys/fcntl.h:3,
                     from /usr/include/fcntl.h:15,
                     from ../src/channel.c:45:
    /usr/include/sys/select.h:31:5: error: conflicting types for ‘select’
     int select __P ((int __n, fd_set *__readfds, fd_set *__writefds,
         ^
    In file included from ../win32/libssh2_config.h:10:0,
                     from ../src/libssh2_priv.h:44,
                     from ../src/channel.c:41:
    /usr/include/w32api/winsock2.h:995:34: note: previous declaration of ‘select’ was here
       WINSOCK_API_LINKAGE int WSAAPI select(int nfds,fd_set *readfds,fd_set *writefds,fd_set *exceptfds,const PTIMEVAL timeout);
                                      ^
    make: *** [release/channel.o] Error 1
    thread '<main>' panicked at 'command did not succeed, exited with: exit code: 2', C:\msys64\<edit>\.cargo\registry\src\github.com-1ecc6299db9ec823\libssh2-sys-0.1.23\build.rs:123
    

    Thanks

    opened by mhristache 12
  • Session in 0.4.0 no longer Send

    Session in 0.4.0 no longer Send

    In version 0.3.3 the Session struct implemented the Send trait unfortunately since in 0.4.0 it's using a std::rc::Rc to store the SessionInner, std::rc::Rc is very explicitly not Send, therefore the ssh2::Session struct is no longer implementing the Send trait.

    Changing the std::rc::Rc to a std::sync::Arc should solve the Problem without a huge performance impact. The Change would need to be made here: https://github.com/alexcrichton/ssh2-rs/blob/master/src/session.rs#L79

    opened by usbpc 11
  • Authentication fails using SSH keys

    Authentication fails using SSH keys

    I am trying to get basic public key/ private key authentication example working. The passwordless login works using the keys I have generated (when connecting manually) but the example below is failing with this error:

    thread 'main' panicked at 'called Result::unwrap() on an Err value: Error { code: Session(-18), msg: "Username/PublicKey combination invalid" }', src/main.rs:107:6

    Here is the example I am using:

    let tcp = TcpStream::connect("192.168.1.131:22").unwrap();
    let mut sess = Session::new().unwrap();
    
    sess.set_tcp_stream(tcp);
    
    sess.handshake().unwrap();
    
    let mut agent = sess.agent().unwrap();
    
    // Connect the agent and request a list of identities
    agent.connect().unwrap();
    agent.list_identities().unwrap();
    
    for identity in agent.identities().unwrap() {
        println!("Comment -> {}", identity.comment());
        //let pubkey = identity.blob();
    }
    
    sess.userauth_pubkey_file(
        "test",
        Some(Path::new(
            "/Users/test/test.pub",
        )),
        Path::new("/Users/test/test.pem"),
        None,
    )
    .unwrap();
    
    println!("Connected for SFTP: {}", sess.authenticated());
    

    Have I missed a step?

    opened by allewi 10
  • Update libssh2 submodule to version 1.10.0

    Update libssh2 submodule to version 1.10.0

    libssh2 version 1.10.0 has just been released.

    I am mainly am interested in the added support for the OpenSSH ssh-agent now shipped with Windows 10.

    Actually, actually fixes #125 and #130.

    opened by yodaldevoid 10
  • How to forward stdin, stdout *and* stderr

    How to forward stdin, stdout *and* stderr

    I want to execute a command remotely and then forward all three streams - stdin, stdout and stderr. This is closely related to #128, but none of the solutions there seem very good. I don't want a busy loop, and this solution looks like it will delay stdin until stdout data is available.

    My theory is that the basic idea is to start a thread for each channel:

    fn execute(session: &Session, command: &str) -> Result<()> {
      let mut channel = session.channel_session()?;
      channel.exec(command)?;
     
      let ssh_stderr = channel.stderr();
      let ssh_stdout = channel.stdout();
      let ssh_stdin = channel.stdin();
    
      crossbeam::scope(|s| {
        s.spawn(|_| {
          let stdin = io::stdin();
          let mut stdin = stdin.lock();
          io::copy(&mut stdin, &mut channel).unwrap(); // TODO: Don't unwrap
        });
    
         // Repeat for stdout/stderr. One of them could go on the main thread.
      }).unwrap();
    
      channel.wait_close()?;
      println!("{}", channel.exit_status()?);
      Ok(())
    }
    

    This almost works. Because channel.stderr() exists and returns a Stream that is Send and Sync. However there doesn't seem to be a way to do the same thing for stdin and stdout - there is no Channel::stdout(). The channel itself implements Read/Write, but I can't mutably borrow it twice in different threads.

    There is stream() which looks like it might be useful, but I'm not sure what to pass it to get stdin/out.

    Any hints?

    opened by Timmmm 10
  • Publish libssh2-sys 0.3.0

    Publish libssh2-sys 0.3.0

    Hi, could a new release for libssh2-sys be published (0.3.0) to crates.io. Looks like upstream libssh2 changes were pulled in that fix a number of issues (specifically getting the sha2 signature algorithm support).

    Can confirm that pointing git2-rs at current master works to fetch from github with an rsa key whereas the latest version on crates.io (0.2.23) doesn't.

    cc @yodaldevoid

    opened by luqmana 1
  • Add Session.userauth_banner

    Add Session.userauth_banner

    Implements #275

    Add a method retrieve the ssh userauth banner. Returns the SSH_MSG_USERAUTH_BANNER message sent by the server. Will return [Session(-50)] missing userauth banner if user auth hasn't yet been attempted.

      let auth_methods = session.auth_methods(user)?;
      
      if let Some(ret) = session.userauth_banner()? {
          println!("{}", ret);
      };    
    

    Example:

    ---------  AT&T IP Services Route Monitor  -----------
    
    The information available through <snipped> is offered
    by AT&T's Internet engineering organization to the Internet community.
    
    This router maintains eBGP peerings with customer-facing routers
    throughout the AT&T IP Services Backbone:
    ...
    
    opened by ScottCUSA 1
  • Error in scp_send to Windows Hosts

    Error in scp_send to Windows Hosts

    I'm hopeful that this is PEBCAK but I can't seem to resolve it no matter what I try. Any attempts to scp_send a file to a windows host seem to fail on anything other than a relative filepath with no directory structures, all other paths panic at runtime with value: Error { code: Session(-28), msg: "failed to send file" }'.

    For example the following code works but it places 'remote' in $HOME of the user and literally includes the single tics in the filename:

        let tcp = TcpStream::connect("IP.ADDR.OF.HOST:22").unwrap();
        let mut sess = Session::new().unwrap();
        sess.set_tcp_stream(tcp);
        sess.handshake().unwrap();
    
        sess.userauth_password(r"DOMAIN\username", "DomainUserPassword").unwrap();
        
        let buf = std::path::PathBuf::from("remote");
        let mut remote_file = sess.scp_send(buf.as_path(),
                                           0o644, 10, None).unwrap();
    
        remote_file.write(b"1234567890").unwrap();
        remote_file.send_eof().unwrap();
        remote_file.wait_eof().unwrap();
        remote_file.close().unwrap();
        remote_file.wait_close().unwrap();
    

    ANY other pattern passed fails with this error including paths expecting that relative path to remain true. Scp to the host works fine from both linux and windows terminals. I see in the Event Viewer logs that there is no authentication issue so I'm kind of at a loss.

    Examples of other paths I have attempted and this list is not exhaustive:

    /C:/remote
    c:/remote
    /c/remote
    /C/remote
    C:\\remote
    c:\\remote
    c\\remote
    C\\remote
    Downloads/remote
    Downloads\\remote
    
    opened by eeyun 0
  • Implement method to call libssh2_userauth_banner

    Implement method to call libssh2_userauth_banner

    Hello,

    Would it be possible to implement a userauth_banner method to return the userauth banner message from libssh2_userauth_banner?

    Maybe return an Option<&str> ?

    If I'm reading the libssh2 docs correctly, libssh2_userauth_banner will return NULL until after libssh2_userauth_list is called, assuming the remote system sends a SSH_MSG_USERAUTH_BANNER message.

    V/R Scott

    opened by ScottCUSA 0
  • Segfault when `File::close` returns error other than EAGAIN

    Segfault when `File::close` returns error other than EAGAIN

    I am using ssh2-rs together with async-ssh2 to make async sftp transfers.

    I have been getting segfaults every so often. The stack trace looks like this:

    # 0 0x0000563ea2aa1cb0 in _libssh2_list_next ()
    # 1 0x0000563ea2aa5360 in sftp_packetlist_flush ()
    # 2 0x0000563ea2aa80e5 in libssh2_sftp_close_handle ()
    # 3 0x0000563ea2a9043c in _$LT$ssh2..sftp..File$u20$as$u20$core..ops..drop..Drop$GT$::drop::h889db86aab1b140f ()
    # 4 0x0000563ea299197d in core::ptr::drop_in_place$LT$async_ssh2..sftp..File$GT$::h8c98be556192ed36 ()
    

    In order to avoid blocking when dropping sftp file handles, I manually call async_ssh2::File::close, which in turn calls ssh2::File::close. That method currently looks like this:

    pub fn close(&mut self) -> Result<(), Error> {
        {
            let locked = self.lock()?;
            self.rc(&locked, unsafe {
                raw::libssh2_sftp_close_handle(locked.raw)
            })?;
        }
        self.inner = None;
        Ok(())
    }
    

    Looking in the source code for libssh2, you can see that if any error other than EAGAIN occurs, it goes ahead and deallocates the resources associated with the file. If you were to call it again after this you would get a crash.

    In the comments it actually says:

    The handle is no longer usable after return of this function, unless the return value is LIBSSH2_ERROR_EAGAIN in which case this function should be called again.

    The problem is, if any error at all occurs, self.inner is not set to None, which means later on when the struct is dropped, libssh2_sftp_close_handle gets called again - which goes on to cause the segfault.

    The solution is to set self.inner to None either if no error occurs, OR if any error other than EAGAIN occurs.

    I will submit a PR containing a fix proposal.

    opened by harmic 0
Owner
Alex Crichton
Alex Crichton
Rust bindings for libssh

libssh-rs Bindings to libssh. This repo is home to the libssh-rs-sys crate, which provides FFI bindings to libssh. Features The vendored feature cause

Wez Furlong 18 Jan 2, 2023
Grow Rust is a Growtopia Private Server made in Rust

Grow Rust is a Growtopia Private Server made in Rust

null 14 Dec 7, 2022
Multiplex server for rust-analyzer, allows multiple LSP clients (editor windows) to share a single rust-analyzer instance per cargo workspace

ra-multiplex   Multiplex server for rust-analyzer, allows multiple LSP clients (editor windows) to share a single rust-analyzer instance per cargo wor

max 95 Dec 29, 2022
DNS Server written in Rust for fun, see https://dev.to/xfbs/writing-a-dns-server-in-rust-1gpn

DNS Fun Ever wondered how you can write a DNS server in Rust? No? Well, too bad, I'm telling you anyways. But don't worry, this is going to be a fun o

Patrick Elsen 26 Jan 13, 2023
Rust crate for configurable parallel web crawling, designed to crawl for content

url-crawler A configurable parallel web crawler, designed to crawl a website for content. Changelog Docs.rs Example extern crate url_crawler; use std:

Pop!_OS 56 Aug 22, 2021
Rust crate for scraping URLs from HTML pages

url-scraper Rust crate for scraping URLs from HTML pages. Example extern crate url_scraper; use url_scraper::UrlScraper; fn main() { let director

Pop!_OS 35 Aug 18, 2022
FTP client for Rust

rust-ftp FTP client for Rust Documentation rust-ftp Installation Usage License Contribution Development environment Installation FTPS support is achie

Matt McCoy 155 Nov 12, 2022
The gRPC library for Rust built on C Core library and futures

gRPC-rs gRPC-rs is a Rust wrapper of gRPC Core. gRPC is a high performance, open source universal RPC framework that puts mobile and HTTP/2 first. Sta

TiKV Project 1.6k Jan 7, 2023
A library to work with CIDRs in rust

ipnetwork This is a library to work with IPv4 and IPv6 CIDRs in Rust Run Clippy by doing rustup component add clippy cargo clippy Installation This c

Abhishek Chanda 98 Dec 12, 2022
Network simulation in Rust

netsim - A Rust library for network simulation and testing (currently linux-only). netsim is a crate for simulating networks for the sake of testing n

Andrew Cann 115 Dec 15, 2022
Cross-platform, low level networking using the Rust programming language.

libpnet Linux ∪ OS X Build Status: Windows Build Status: Discussion and support: #libpnet on freenode / #rust-networking on irc.mozilla.org / #rust on

null 1.8k Jan 6, 2023
A runtime for writing reliable asynchronous applications with Rust. Provides I/O, networking, scheduling, timers, ...

Tokio A runtime for writing reliable, asynchronous, and slim applications with the Rust programming language. It is: Fast: Tokio's zero-cost abstracti

Tokio 18.7k Dec 30, 2022
Easy protocol definitions in Rust

protocol Documentation Easy protocol definitions in Rust. This crate adds a custom derive that can be added to types, allowing structured data to be s

Dylan McKay 157 Dec 30, 2022
Actor framework for Rust.

Actix Actor framework for Rust Documentation User Guide API Documentation API Documentation (master branch) Features Async and sync actors Actor commu

Actix 7.6k Jan 7, 2023
Nanomsg library for Rust

Nanomsg Documentation Nanomsg is a modern messaging library that is the successor to ZeroMQ, written in C by Martin Sustrik and colleagues. The nanoms

Daniel Fagnan 371 Nov 18, 2022
NNTP client for Rust

rust-nntp NNTP Client for Rust Usage extern crate nntp; use nntp::{Article, NNTPStream}; fn main() { let mut nntp_stream = match NNTPStream::connec

Matt McCoy 13 Jan 22, 2022
POP3 client for Rust

rust-pop3 POP3 Client for Rust This client has SSL support. SSL is configured using an SSLContext that is passed into the connect method of a POP3Stre

Matt McCoy 26 Dec 19, 2022
A STOMP client in Rust. Compatible with RabbitMQ, ActiveMQ.

stomp-rs stomp-rs provides a full STOMP 1.2 client implementation for the Rust programming language. This allows programs written in Rust to interact

Zack Slayton 84 Dec 4, 2022
A µTP (Micro/uTorrent Transport Library) library implemented in Rust

rust-utp A Micro Transport Protocol library implemented in Rust. API documentation Overview The Micro Transport Protocol is a reliable transport proto

Ricardo Martins 134 Dec 11, 2022