This commit is contained in:
10
Dockerfile
Normal file
10
Dockerfile
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
FROM debian:bookworm-slim
|
||||||
|
|
||||||
|
RUN apt-get update \
|
||||||
|
&& apt-get install -y libcurl4 \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
COPY header_proxy /usr/local/bin/header_proxy
|
||||||
|
|
||||||
|
ENTRYPOINT ["/usr/local/bin/header_proxy"]
|
||||||
|
|
||||||
10
build_docker_image.sh
Executable file
10
build_docker_image.sh
Executable file
@@ -0,0 +1,10 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
cargo build --release
|
||||||
|
|
||||||
|
TEMP_DIR=$(mktemp -d)
|
||||||
|
cp target/release/header_proxy "$TEMP_DIR"
|
||||||
|
|
||||||
|
docker build -f Dockerfile "$TEMP_DIR" -t pierre42100/header_proxy
|
||||||
|
|
||||||
|
rm -r $TEMP_DIR
|
||||||
|
|
||||||
@@ -175,6 +175,8 @@ fn process_headers(buff: &[u8]) -> anyhow::Result<Option<ProcessHeadersResult>>
|
|||||||
.find(|h| h.name.eq_ignore_ascii_case(&ARGS.target_host_port_header))
|
.find(|h| h.name.eq_ignore_ascii_case(&ARGS.target_host_port_header))
|
||||||
.map(|h| String::from_utf8_lossy(h.value));
|
.map(|h| String::from_utf8_lossy(h.value));
|
||||||
|
|
||||||
|
log::debug!("Request headers: {:?}", headers);
|
||||||
|
|
||||||
let Some(target_host) = target_host else {
|
let Some(target_host) = target_host else {
|
||||||
if parsing_res.is_partial() {
|
if parsing_res.is_partial() {
|
||||||
return Ok(None);
|
return Ok(None);
|
||||||
|
|||||||
Reference in New Issue
Block a user