Skip to content

Instantly share code, notes, and snippets.

View marcobacis's full-sized avatar

Marco Bacis marcobacis

View GitHub Profile
@marcobacis
marcobacis / Cargo.toml
Created May 5, 2024 09:01
Simple HTTP forward in Rust using actix and reqwest
[package]
name = "lb"
version = "0.1.0"
edition = "2021"
[lib]
name = "lb"
path = "lib.rs"
[dependencies]
@marcobacis
marcobacis / loadbalancer.rs
Created May 22, 2024 16:00
Load Balancer in Rust - Part 2
use std::{
fmt::Display,
sync::atomic::{AtomicUsize, Ordering},
};
use actix_web::{
http::header::ContentType,
web::{self, Data},
App, HttpRequest, HttpResponse, HttpServer, ResponseError,
};