Hirevo / mega-rs

An API client library for interacting with MEGA from Rust

Home Page:https://crates.io/crates/mega

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to use proxy ?

fukttt opened this issue · comments

How to use proxy ?

Hi !
Are you asking how to proxy the HTTP requests made by this library through another server ?

If so, this library allows you to freely configure your HTTP client (reqwest::Client) before passing it over to be used by mega::Client.

This means that you can use the proxying features of reqwest to make this work, like so:

let http_client = reqwest::Client::builder()
    .proxy(reqwest::Proxy::all("http://pro.xy")?)
    .build()?;

let mega_client = mega::Client::builder()
    .build(http_client)?;

// Every HTTP/S requests made by this `mega_client` shall now be proxied accordingly.

You can get more information about how proxying works within reqwest in its dedicated docs.rs page.

Sorry for the delay of this response and I hope this helps.
Feel free to comment again if this answer doesn't solve your issue.