Revproxy is working. Added example cgi script

This commit is contained in:
int 80h
2020-05-10 17:18:14 -04:00
parent ae2d7e0092
commit 26b55f7d1e
6 changed files with 85 additions and 37 deletions

View File

@@ -124,9 +124,13 @@ async fn handle_connection(mut con: conn::Connection, srv: &config::ServerCfg) -
};
if srv.proxy.len() != 0 {
match srv.proxy.get(url.path()) {
let seg = match url.path_segments().map(|c| c.collect::<Vec<_>>()) {
Some(s) => s,
None => return Ok(()),
};
match srv.proxy.get(seg[0]) {
Some(p) => {
revproxy::proxy(p.to_string(), url).await?;
revproxy::proxy(p.to_string(), url, con).await?;
return Ok(());
},
None => {},