Code Upload

This commit is contained in:
PinkP4nther 2021-08-18 00:08:06 -07:00
commit a879755865
9 changed files with 949 additions and 0 deletions

View file

@ -0,0 +1,9 @@
[package]
name = "basic"
version = "0.1.0"
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
sslrelay = {path = "../SSLRelay-lib"}

44
examples/basic/main.rs Normal file
View file

@ -0,0 +1,44 @@
use sslrelay::{self, ConfigType, HandlerCallbacks};
// Handler object
struct Handler;
/*
Callback traits that can be used to read or inject data
into data upstream or downstream.
*/
impl HandlerCallbacks for Handler {
// Request non blocking callback
fn req_nb_callback(&self, _in_data: Vec<u8>) {
println!("[+] Request Non Blocking CallBack!");
}
// Request blocking callback
fn req_b_callback(&self, _in_data: &mut Vec<u8>) {
println!("[+] Request Blocking CallBack!");
}
// Response non blocking callback
fn res_nb_callback(&self, _in_data: Vec<u8>) {
println!("[+] Response Non Blocking CallBack!");
}
// Response blocking callback
fn res_b_callback(&self, _in_data: &mut Vec<u8>) {
println!("[+] Response Blocking CallBack!");
}
}
fn main() {
// Create new SSLRelay object
let mut relay = sslrelay::SSLRelay::new(Handler);
// Load Configuration
relay.load_config(ConfigType::Default);
// Start listening
relay.start();
}

View file

@ -0,0 +1,7 @@
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"