use core::{ future::Future, pin::Pin, task::{Context, Poll}, }; use std::path::PathBuf; use hyper::{ client::{Client, HttpConnector}, http::{Request, Response}, service::Service, Body, }; use super::route::Route; /// A ProxyServer is an implementation of `hyper::service::Service` that proxies requests to a /// given list of routes. pub struct ProxyServer { routes: Vec, } impl Service> for ProxyServer { type Response = super::Route; type Error = hyper::http::Error; type Future = Pin>>>; /// This function lets hyper know when the service is ready to process requests. fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll> { Poll::Ready(Ok(())) } /// Processes incoming requests by proxying them to other hosts. fn call(&mut self, req: Request) -> Self::Future {} }