mirror of
https://github.com/sadoyan/aralez.git
synced 2026-04-30 23:08:40 +08:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fce25b8d15 |
684
Cargo.lock
generated
684
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
14
Cargo.toml
14
Cargo.toml
@@ -4,14 +4,16 @@ version = "0.1.0"
|
|||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
[profile.release]
|
[profile.release]
|
||||||
|
opt-level = 3
|
||||||
lto = true
|
lto = true
|
||||||
codegen-units = 1
|
codegen-units = 1
|
||||||
opt-level = 3
|
panic = "abort"
|
||||||
strip = "symbols"
|
strip = true
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
tokio = { version = "1.45.0", features = ["full"] }
|
tokio = { version = "1.45.0", features = ["full"] }
|
||||||
pingora = { version = "0.5.0", features = ["lb", "rustls"] } # openssl, rustls, boringssl
|
#pingora = { version = "0.5.0", features = ["lb", "rustls"] } # openssl, rustls, boringssl
|
||||||
|
pingora = { version = "0.5.0", features = ["lb", "openssl"] } # openssl, rustls, boringssl
|
||||||
serde = { version = "1.0.219", features = ["derive"] }
|
serde = { version = "1.0.219", features = ["derive"] }
|
||||||
dashmap = "7.0.0-rc2"
|
dashmap = "7.0.0-rc2"
|
||||||
pingora-core = "0.5.0"
|
pingora-core = "0.5.0"
|
||||||
@@ -23,9 +25,9 @@ log = "0.4.27"
|
|||||||
futures = "0.3.31"
|
futures = "0.3.31"
|
||||||
notify = "8.0.0"
|
notify = "8.0.0"
|
||||||
axum = { version = "0.8.4" }
|
axum = { version = "0.8.4" }
|
||||||
#reqwest = { version = "0.12.15", features = ["json", "native-tls-alpn"] }
|
reqwest = { version = "0.12.15", features = ["json", "native-tls-alpn"] }
|
||||||
#reqwest = { version = "0.12.15", features = ["json", "rustls-tls"] }
|
#reqwest = { version = "0.12.15", features = ["json", "rustls-tls"] }
|
||||||
reqwest = { version = "0.12.15", default-features = false, features = ["rustls-tls", "json"] }
|
#reqwest = { version = "0.12.15", default-features = false, features = ["rustls-tls", "json"] }
|
||||||
|
|
||||||
serde_yaml = "0.9.34-deprecated"
|
serde_yaml = "0.9.34-deprecated"
|
||||||
rand = "0.9.0"
|
rand = "0.9.0"
|
||||||
@@ -36,6 +38,6 @@ sha2 = { version = "0.11.0-pre.5", default-features = false }
|
|||||||
base16ct = { version = "0.2.0", features = ["alloc"] }
|
base16ct = { version = "0.2.0", features = ["alloc"] }
|
||||||
urlencoding = "2.1.3"
|
urlencoding = "2.1.3"
|
||||||
arc-swap = "1.7.1"
|
arc-swap = "1.7.1"
|
||||||
rustls = { version = "0.23.27", features = ["ring"] }
|
#rustls = { version = "0.23.27", features = ["ring"] }
|
||||||
mimalloc = { version = "0.1.46", default-features = false }
|
mimalloc = { version = "0.1.46", default-features = false }
|
||||||
|
|
||||||
|
|||||||
@@ -84,7 +84,13 @@ impl ProxyHttp for LB {
|
|||||||
peer.options.verify_cert = false;
|
peer.options.verify_cert = false;
|
||||||
peer.options.verify_hostname = false;
|
peer.options.verify_hostname = false;
|
||||||
}
|
}
|
||||||
// println!(" ==> {} ==> {} => {} => {:?}", hostname, address.as_str(), peer.options.alpn, is_h2);
|
// info!(
|
||||||
|
// "upstream peer: hostname {}, address{}, alpn {}, h2 {:?}",
|
||||||
|
// hostname,
|
||||||
|
// address.as_str(),
|
||||||
|
// peer.options.alpn,
|
||||||
|
// is_h2
|
||||||
|
// );
|
||||||
_ctx.backend_id = format!("{}:{}:{}", address.clone(), port.clone(), ssl);
|
_ctx.backend_id = format!("{}:{}:{}", address.clone(), port.clone(), ssl);
|
||||||
Ok(peer)
|
Ok(peer)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,12 +5,12 @@ use dashmap::DashMap;
|
|||||||
use log::info;
|
use log::info;
|
||||||
use pingora_core::prelude::{background_service, Opt};
|
use pingora_core::prelude::{background_service, Opt};
|
||||||
use pingora_core::server::Server;
|
use pingora_core::server::Server;
|
||||||
use rustls::crypto::ring::default_provider;
|
// use rustls::crypto::ring::default_provider;
|
||||||
use std::env;
|
use std::env;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
pub fn run() {
|
pub fn run() {
|
||||||
default_provider().install_default().expect("Failed to install rustls crypto provider");
|
// default_provider().install_default().expect("Failed to install rustls crypto provider");
|
||||||
let parameters = Some(Opt::parse_args()).unwrap();
|
let parameters = Some(Opt::parse_args()).unwrap();
|
||||||
let file = parameters.conf.clone().unwrap();
|
let file = parameters.conf.clone().unwrap();
|
||||||
let maincfg = crate::utils::parceyaml::parce_main_config(file.as_str());
|
let maincfg = crate::utils::parceyaml::parce_main_config(file.as_str());
|
||||||
@@ -50,16 +50,18 @@ pub fn run() {
|
|||||||
// env_logger::init();
|
// env_logger::init();
|
||||||
|
|
||||||
let log_level = cfg.log_level.clone();
|
let log_level = cfg.log_level.clone();
|
||||||
match log_level.as_str() {
|
unsafe {
|
||||||
"info" => env::set_var("RUST_LOG", "info"),
|
match log_level.as_str() {
|
||||||
"error" => env::set_var("RUST_LOG", "error"),
|
"info" => env::set_var("RUST_LOG", "info"),
|
||||||
"warn" => env::set_var("RUST_LOG", "warn"),
|
"error" => env::set_var("RUST_LOG", "error"),
|
||||||
"debug" => env::set_var("RUST_LOG", "debug"),
|
"warn" => env::set_var("RUST_LOG", "warn"),
|
||||||
"trace" => env::set_var("RUST_LOG", "trace"),
|
"debug" => env::set_var("RUST_LOG", "debug"),
|
||||||
"off" => env::set_var("RUST_LOG", "off"),
|
"trace" => env::set_var("RUST_LOG", "trace"),
|
||||||
_ => {
|
"off" => env::set_var("RUST_LOG", "off"),
|
||||||
println!("Error reading log level, defaulting to: INFO");
|
_ => {
|
||||||
env::set_var("RUST_LOG", "info")
|
println!("Error reading log level, defaulting to: INFO");
|
||||||
|
env::set_var("RUST_LOG", "info")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
env_logger::builder()
|
env_logger::builder()
|
||||||
|
|||||||
Reference in New Issue
Block a user