initial commit

This commit is contained in:
2026-02-22 20:58:47 +07:00
parent 89b3037556
commit bf7d50bcef
61 changed files with 3840 additions and 0 deletions
@@ -0,0 +1,33 @@
use crate::{
protocol::interceptors::{
error_interceptor::interceptor_error::InterceptorError, interceptor::Interceptor,
},
tlseng::tls::ApplicationData,
};
impl Interceptor for ApplicationData {
type Error = InterceptorError;
fn can_handle(bytes: &bytes::BytesMut) -> bool {
// Application Data не может быть пустым по спецификации (хотя бы 1 байт)
!bytes.is_empty()
}
fn intercept(bytes: &mut bytes::BytesMut) -> Result<Option<Self>, Self::Error>
where
Self: Sized,
{
let len = bytes.len();
if len == 0 {
return Ok(None);
}
let payload = bytes.split_to(len).freeze();
Ok(Some(Self {
length: len,
payload,
}))
}
}