split proxy into stream handler and http message handler

This commit is contained in:
Jun Kurihara 2022-07-10 03:11:46 +09:00
commit 954a1993a9
No known key found for this signature in database
GPG key ID: 48ADFD173ED22B03
14 changed files with 92 additions and 71 deletions

16
src/backend_opt.rs Normal file
View file

@ -0,0 +1,16 @@
use crate::error::*;
#[derive(Debug, Clone, Hash, Eq, PartialEq)]
pub enum UpstreamOption {
OverrideHost,
// TODO: Adds more options for heder override
}
impl TryFrom<&str> for UpstreamOption {
type Error = anyhow::Error;
fn try_from(val: &str) -> Result<Self> {
match val {
"override_host" => Ok(Self::OverrideHost),
_ => Err(anyhow!("Unsupported header option")),
}
}
}