Crates.io | rust_tcp_sever |
lib.rs | rust_tcp_sever |
version | 0.2.3 |
source | src |
created_at | 2024-07-19 10:33:58.084793 |
updated_at | 2024-11-22 05:14:03.069731 |
description | A simple and lightweight crate for launching and using a server. |
homepage | |
repository | https://gitverse.ru/Amakesasha/Rust-TcpSever |
max_upload_size | |
id | 1308524 |
size | 32,166 |
[dependencies]
rust_tcp_sever = "0.2.3"
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:#?}");
}
}
The library will be updated as new proposals and ideas are received. I will try to post a new update every month.