1
0
Fork 0
mirror of https://github.com/librespot-org/librespot.git synced 2025-10-06 03:50:06 +02:00

Add support for http proxy

Currently only http proxy (no https) is supported.
This commit is contained in:
Johan Anderholm 2018-03-23 06:15:15 +01:00
parent 612978908f
commit 3bdc5e0073
8 changed files with 170 additions and 17 deletions

View file

@ -50,12 +50,13 @@ impl Session {
cache: Option<Cache>,
handle: Handle,
) -> Box<Future<Item = Session, Error = io::Error>> {
let access_point = apresolve_or_fallback::<io::Error>(&handle);
let access_point = apresolve_or_fallback::<io::Error>(&handle, &config.proxy);
let handle_ = handle.clone();
let proxy = config.proxy.clone();
let connection = access_point.and_then(move |addr| {
info!("Connecting to AP \"{}\"", addr);
connection::connect::<&str>(&addr, &handle_)
connection::connect::<&str>(&addr, &handle_, &proxy)
});
let device_id = config.device_id.clone();