Skip to content

Latest commit

 

History

History
55 lines (44 loc) · 1.68 KB

README.md

File metadata and controls

55 lines (44 loc) · 1.68 KB

Rust TcpSever

Rust TcpSever is a simple and lightweight crate for launching and using a server.

github.com license crates.io Documentation

Supported Protocols

Usage examples:

Cargo.toml:

[dependencies]
rust_tcp_sever = "0.2.2"

src/main.rs:

use rust_tcp_sever::*;

fn main() {
    Server::http_launch(TcpListener::bind("127.0.0.1:80").unwrap(), 4);
}

struct Server;

impl HttpControl for Server {
    #[inline]
    fn check_stream(stream: &TcpStream) -> bool { true }

    #[inline]
    fn parser_request(_stream: &TcpStream, request: &Request, response: &mut Response) { 
        println!("{request:#?}");
        println!("\n\n\n\n");
        println!("{response:#?}");
    }
}

Future of the Library

The library will be updated as new proposals and ideas are received. I will try to post a new update every month.