#tcp #http-response #http-request #redirect #request-response

tcp-request

A Rust library for sending raw TCP requests, with features for handling responses, managing redirects, and working with compressed data over TCP connections

56 stable releases

Uses new Rust 2024

new 2.2.1 Apr 19, 2025
2.1.2 Mar 29, 2025
1.11.10 Mar 2, 2025
0.8.0 Jan 5, 2025

#2231 in Network programming

Download history 1320/week @ 2025-01-01 949/week @ 2025-01-08 1540/week @ 2025-01-15 170/week @ 2025-01-22 97/week @ 2025-01-29 473/week @ 2025-02-05 547/week @ 2025-02-12 760/week @ 2025-02-19 1051/week @ 2025-02-26 282/week @ 2025-03-05 37/week @ 2025-03-12 230/week @ 2025-03-19 127/week @ 2025-03-26 246/week @ 2025-04-02 115/week @ 2025-04-09

720 downloads per month

MIT license

17KB
396 lines

tcp-request

Official Documentation

Api Docs

A Rust library for sending raw TCP requests, with features for handling responses, managing redirects, and working with compressed data over TCP connections.

Installation

To use this crate, you can run cmd:

cargo add tcp-request

Use

Receive Text

use tcp_request::*;

let mut request_builder = RequestBuilder::new()
    .host("127.0.0.1")
    .port(80)
    .build();
request_builder
    .send("tcp send".as_bytes())
    .and_then(|response| {
        println!("ResponseTrait => {:?}", response.text());
        Ok(())
    })
    .unwrap_or_else(|e| println!("Error => {:?}", e));

Receive Binary

use tcp_request::*;

let mut request_builder = RequestBuilder::new()
    .host("127.0.0.1")
    .port(80)
    .build();
request_builder
    .send("tcp send".as_bytes())
    .and_then(|response| {
        println!("ResponseTrait => {:?}", response.binary());
        Ok(())
    })
    .unwrap_or_else(|e| println!("Error => {:?}", e));

Help

Ensure that CMake is installed on the system

License

This project is licensed under the MIT License. See the LICENSE file for details.

Contributing

Contributions are welcome! Please open an issue or submit a pull request.

Contact

For any inquiries, please reach out to the author at ltpp-universe root@ltpp.vip.

Dependencies

~205–640KB
~15K SLoC