// Copyright (c) 2016 The Rouille developers // Licensed under the Apache License, Version 2.0 // or the MIT // license , // at your option. All files in the project carrying such // notice may not be copied, modified, or distributed except // according to those terms. extern crate rouille_ng; fn main() { // This example shows how to create a reverse proxy with rouille_ng. println!("Now listening on localhost:8000"); rouille_ng::start_server("localhost:8000", move |request| { rouille_ng::proxy::full_proxy( &request, rouille_ng::proxy::ProxyConfig { addr: "example.com:80", replace_host: Some("example.com".into()), }, ) .unwrap() }); }