feat: works
This commit is contained in:
30
src/main.rs
30
src/main.rs
@@ -6,16 +6,14 @@ use pingora::{
|
||||
use pretty_env_logger::env_logger::Builder;
|
||||
use structopt::StructOpt;
|
||||
|
||||
use crate::service::HostConfig;
|
||||
|
||||
mod app;
|
||||
mod service;
|
||||
mod cert;
|
||||
|
||||
pub fn main() {
|
||||
init_logger();
|
||||
let cert = cert::issue_certificate("example.com");
|
||||
println!("{:#?}", cert);
|
||||
println!("{}", cert.cert_pem);
|
||||
panic!("END");
|
||||
|
||||
let opt = Some(Opt::from_args());
|
||||
let mut my_server = Server::new(opt).unwrap();
|
||||
@@ -31,20 +29,16 @@ pub fn main() {
|
||||
&my_server.configuration,
|
||||
"0.0.0.0:4430",
|
||||
vec![
|
||||
// HostConfig {
|
||||
// proxy_addr: "127.0.0.1:4000".to_owned(),
|
||||
// proxy_tls: false,
|
||||
// proxy_hostname: "somedomain.com".to_owned(),
|
||||
// cert_path: format!("{}/keys/some_domain_cert.crt", env!("CARGO_MANIFEST_DIR")),
|
||||
// key_path: format!("{}/keys/some_domain_key.pem", env!("CARGO_MANIFEST_DIR")),
|
||||
// },
|
||||
// HostConfig {
|
||||
// proxy_addr: "1.1.1.1:443".to_owned(),
|
||||
// proxy_tls: true,
|
||||
// proxy_hostname: "one.one.one.one".to_owned(),
|
||||
// cert_path: format!("{}/keys/one_cert.crt", env!("CARGO_MANIFEST_DIR")),
|
||||
// key_path: format!("{}/keys/one_key.pem", env!("CARGO_MANIFEST_DIR")),
|
||||
// },
|
||||
HostConfig {
|
||||
proxy_addr: "101.132.122.240:443".to_owned(),
|
||||
proxy_tls: true,
|
||||
proxy_hostname: "hatter.ink".to_owned(),
|
||||
},
|
||||
HostConfig {
|
||||
proxy_addr: "1.1.1.1:443".to_owned(),
|
||||
proxy_tls: true,
|
||||
proxy_hostname: "one.one.one.one".to_owned(),
|
||||
},
|
||||
],
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user