I'm working with Caddy right now but I'd like to move to a rust based solution that allows me to spawn new services as i need. I think pingora is the solution but am having a lot of trouble getting a minimal example running.
I'm trying to adapt the quickstart reverse proxy to work with a local service but am having no luck.
For example i have a local app running at 127.0.0.1:9000

I've modified the LoadBalancer so that it only calls the local service.
fn main() {
let mut my_server = Server::new(None).unwrap();
my_server.bootstrap();
let r = SocketAddr::from_str("127.0.0.1:9000").unwrap();
let upstreams = LoadBalancer::try_from_iter([r]).unwrap();
let mut lb = http_proxy_service(&my_server.configuration, LB(Arc::new(upstreams)));
lb.add_tcp("0.0.0.0:6188");
my_server.add_service(lb);
my_server.run_forever();
}
However, when I run this I get a 502 in the browser and there is no messaging being printed to stdout as to why this might be.

Are there any examples that illustrate proxying to a local service?
Ideally, I'd have a struct that can represent the app / service that can spawn new instances based on demand on random ports by, I think, implementing the Service trait. but before that, i'd need to prove that pingora can even proxy to a local app.
I'm working with Caddy right now but I'd like to move to a rust based solution that allows me to spawn new services as i need. I think pingora is the solution but am having a lot of trouble getting a minimal example running.
I'm trying to adapt the quickstart reverse proxy to work with a local service but am having no luck.
For example i have a local app running at

127.0.0.1:9000I've modified the
LoadBalancerso that it only calls the local service.However, when I run this I get a 502 in the browser and there is no messaging being printed to stdout as to why this might be.

Are there any examples that illustrate proxying to a local service?
Ideally, I'd have a struct that can represent the app / service that can spawn new instances based on demand on random ports by, I think, implementing the
Servicetrait. but before that, i'd need to prove that pingora can even proxy to a local app.