Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use proxy ? #17

Closed
fukttt opened this issue Feb 29, 2024 · 1 comment
Closed

How to use proxy ? #17

fukttt opened this issue Feb 29, 2024 · 1 comment
Assignees

Comments

@fukttt
Copy link

fukttt commented Feb 29, 2024

How to use proxy ?

@Hirevo Hirevo self-assigned this Mar 12, 2024
@Hirevo
Copy link
Owner

Hirevo commented Mar 12, 2024

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.

@Hirevo Hirevo closed this as completed Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants