New feature: Data Stream Types (TLS/RAW). Performance enhancements. (V0.4.0)
This commit is contained in:
parent
52a5e40748
commit
490caf9e5e
9 changed files with 383 additions and 165 deletions
|
|
@ -1,4 +1,4 @@
|
|||
use sslrelay::{self, ConfigType, RelayConfig, HandlerCallbacks, CallbackRet};
|
||||
use sslrelay::{self, ConfigType, RelayConfig, HandlerCallbacks, CallbackRet, TCPDataType};
|
||||
|
||||
// Handler object
|
||||
#[derive(Clone)] // Must have Clone trait implemented.
|
||||
|
|
@ -36,18 +36,19 @@ impl HandlerCallbacks for Handler {
|
|||
fn main() {
|
||||
|
||||
// Create new SSLRelay object
|
||||
let mut relay = sslrelay::SSLRelay::new(Handler);
|
||||
|
||||
// Load Configuration
|
||||
relay.load_config(ConfigType::Conf(RelayConfig {
|
||||
bind_host: "0.0.0.0".to_string(),
|
||||
bind_port: "443".to_string(),
|
||||
remote_host: "remote.com".to_string(),
|
||||
remote_port: "443".to_string(),
|
||||
ssl_private_key_path: "./remote.com.key".to_string(),
|
||||
ssl_cert_path: "./remote.com.crt".to_string(),
|
||||
}));
|
||||
|
||||
let mut relay = sslrelay::SSLRelay::new(
|
||||
Handler,
|
||||
ConfigType::Conf(RelayConfig {
|
||||
downstream_data_type: TCPDataType::TLS,
|
||||
upstream_data_type: TCPDataType::TLS,
|
||||
bind_host: "0.0.0.0".to_string(),
|
||||
bind_port: "443".to_string(),
|
||||
remote_host: "remote.com".to_string(),
|
||||
remote_port: "443".to_string(),
|
||||
ssl_private_key_path: "./remote.com.key".to_string(),
|
||||
ssl_cert_path: "./remote.com.crt".to_string(),
|
||||
})
|
||||
);
|
||||
// Start listening
|
||||
relay.start();
|
||||
}
|
||||
|
|
@ -3,4 +3,6 @@ bind_port = "443"
|
|||
ssl_private_key_path = "./remote.com.key"
|
||||
ssl_cert_path = "./remote.com.crt"
|
||||
remote_host = "remote.com"
|
||||
remote_port = "443"
|
||||
remote_port = "443"
|
||||
downstream_data_type = "tls"
|
||||
upstream_data_type = "tls"
|
||||
|
|
@ -38,10 +38,7 @@ impl HandlerCallbacks for Handler {
|
|||
fn main() {
|
||||
|
||||
// Create new SSLRelay object
|
||||
let mut relay = sslrelay::SSLRelay::new(Handler);
|
||||
|
||||
// Load Configuration
|
||||
relay.load_config(ConfigType::Default);
|
||||
let mut relay = sslrelay::SSLRelay::new(Handler, ConfigType::Default);
|
||||
|
||||
// Start listening
|
||||
relay.start();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue