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

Detect and use the system-configured network proxy when Robrix makes any Matrix API calls #344

Open
alanpoon opened this issue Jan 23, 2025 · 3 comments
Labels
blocked-on-robius Blocked on a Project Robius component

Comments

@alanpoon
Copy link
Contributor

Currently, Matrix API does not come with System proxies detection. If the user needs to use a VPN, he needs to set environmental variables HTTP_PROXYS. Setting Wifi proxies would be useless. Makepad's http request might already be respecting system proxies since it is making HTTP requests using platform specific libraries. By default, Electron respects the system-wide proxy settings configured on the operating system. These settings are used by Chromium to route all network requests made by the Electron app.

@alanpoon alanpoon added the question Just a question; not a feature or bug label Jan 23, 2025
@kevinaboos
Copy link
Member

Ah interesting, I have no experience using a proxy. Is this something that the Matrix SDK needs to support, or are you saying we need to add explicit support for this into Robrix?

@alanpoon
Copy link
Contributor Author

Ah interesting, I have no experience using a proxy. Is this something that the Matrix SDK needs to support, or are you saying we need to add explicit support for this into Robrix?

I suggest adding explicit support for this into Robrix. I think Matrix Client allows customized reqwest Client including proxy.

use std::process::Command;

fn get_macos_proxies() {
    let output = Command::new("scutil")
        .arg("--proxy")
        .output()
        .expect("Failed to execute scutil");
    println!("{}", String::from_utf8_lossy(&output.stdout));
}

Might need to find the system proxy manually and customize the reqwest client for Matrix Client.

@kevinaboos kevinaboos removed the question Just a question; not a feature or bug label Jan 24, 2025
@kevinaboos
Copy link
Member

ah ok, so this requires a new robius-proxy crate or something like that to detect/query the platform-maintained proxy, and then we'd need to apply it to Matrix SDK calls from Robrix.

I have seen proxy arguments explicitly supported in some matrix SDK functions; Robrix currently accepts it on the command line and passes it into the client builder, but it's certainly not yet getting it from the underlying platform.

@kevinaboos kevinaboos added the blocked-on-robius Blocked on a Project Robius component label Jan 24, 2025
@kevinaboos kevinaboos changed the title Missing System proxies detection when making Matrix API calls Detect and use the system-configured network proxy when Robrix makes any Matrix API calls Feb 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked-on-robius Blocked on a Project Robius component
Projects
None yet
Development

No branches or pull requests

2 participants