tobaru 0.9.3

Port forwarding CLI utility written in Rust with allowlists, TLS SNI and ALPN routing, HTTP forwarding, load balancing, IP-to-destination mapping, and iptables support.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use std::ops::Deref;

pub trait HeaderTuple {
    fn append_header_to_string(&self, s: &mut String);
}

impl<S, T> HeaderTuple for (&S, &T)
where
    S: Deref<Target = str>,
    T: Deref<Target = str>,
{
    fn append_header_to_string(&self, s: &mut String) {
        s.push_str(self.0.deref());
        s.push_str(": ");
        s.push_str(self.1.deref());
        s.push_str("\r\n");
    }
}