Data handling completely rebuilt. Now correctly handles all TCP/IP traffic.

This commit is contained in:
PinkP4nther 2021-09-02 21:06:27 -07:00
commit f19c7d8f2a
12 changed files with 493 additions and 604 deletions

View file

@ -1,7 +0,0 @@
bind_host = "0.0.0.0"
bind_port = "443"
ssl_private_key_path = "./remote.com.key"
ssl_cert_path = "./remote.com.crt"
remote_host = "remote.com"
remote_port = "443"
verbose_level = "2"

View file

@ -1,7 +1,7 @@
use sslrelay::{self, ConfigType, RelayConfig, HandlerCallbacks};
// Handler object
#[derive(Clone)] // Must have Clone trait implemented.
struct Handler;
/*
@ -10,24 +10,24 @@ struct Handler;
*/
impl HandlerCallbacks for Handler {
// Request non blocking callback
// DownStream non blocking callback
fn ds_nb_callback(&self, _in_data: Vec<u8>) {
println!("[+] Request Non Blocking CallBack!");
println!("[CALLBACK] Down Stream Non Blocking CallBack!");
}
// Request blocking callback
// DownStream blocking callback
fn ds_b_callback(&self, _in_data: &mut Vec<u8>) {
println!("[+] Request Blocking CallBack!");
println!("[CALLBACK] Down Stream Blocking CallBack!");
}
// Response non blocking callback
// UpStream non blocking callback
fn us_nb_callback(&self, _in_data: Vec<u8>) {
println!("[+] Response Non Blocking CallBack!");
println!("[CALLBACK] Up Stream Non Blocking CallBack!");
}
// Response blocking callback
// UpStream blocking callback
fn us_b_callback(&self, _in_data: &mut Vec<u8>) {
println!("[+] Response Blocking CallBack!");
println!("[CALLBACK] Up Stream Blocking CallBack!");
}
}
@ -44,7 +44,6 @@ fn main() {
remote_port: "443".to_string(),
ssl_private_key_path: "./remote.com.key".to_string(),
ssl_cert_path: "./remote.com.crt".to_string(),
verbose_level: 2,
}));
// Start listening