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

Don't set the internet Settings correctly #50

Open
irocn opened this issue Feb 24, 2023 · 2 comments
Open

Don't set the internet Settings correctly #50

irocn opened this issue Feb 24, 2023 · 2 comments

Comments

@irocn
Copy link

irocn commented Feb 24, 2023

Hello,

I want to set windows proxy as "socks=127.0.0.1" and port 1080, but it will be "http://socks=127.0.0.1".
How to fix it?

    let (key, _) = RegKey::predef(HKEY_CURRENT_USER).create_subkey("Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings")?;
    if isOpen{
        key.set_value("ProxyEnable", &1u32)?;
        key.set_value("ProxyServer", &format!("{}:{}", "socks=127.0.0.1", 1080))?;
        key.set_value("ProxyOverride", &"<local>")?;
    }else{
        key.set_value("ProxyEnable", &0u32)?;
    }
@gentoo90
Copy link
Owner

I don't understand the question. Your code does exactly what it should and sets the proxy settings like this:
изображение

"http://socks=127.0.0.1/"

is this what appears in the address string of the browser?

@irocn
Copy link
Author

irocn commented Feb 26, 2023

yes, but in the socks address box is "http://socks=127.0.0.1", the prefix "http://" will be added auto.
my os is windows 11.

btw, "http://socks=127.0.0.1" don't work, "socks=127.0.0.1" work well.

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