#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

63 releases (stable)

new 2.0.7 Mar 11, 2025
1.11.10 Mar 2, 2025
0.8.0 Jan 5, 2025

#1491 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

2,655 downloads per month

MIT license

18KB
413 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–650KB
~15K SLoC