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

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

44 releases (stable)

new 1.10.20 Feb 9, 2025
1.10.16 Jan 22, 2025
0.8.0 Jan 5, 2025

#1878 in Network programming

Download history 904/week @ 2024-12-30 1249/week @ 2025-01-06 937/week @ 2025-01-13 883/week @ 2025-01-20 8/week @ 2025-01-27 290/week @ 2025-02-03

2,265 downloads per month
Used in tcplane

MIT license

20KB
476 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

Send Text

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

Send Binary

use tcp_request::*;
let mut request_builder = RequestBuilder::new()
    .host("127.0.0.1")
    .port(80)
    .data("tcp send".as_bytes())
    .build();
request_builder
    .send()
    .and_then(|response| {
        println!("ResponseTrait => {:?}", response.text());
        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

~12–19MB
~408K SLoC