Add --proxy to Rclone

Hi, Rclone is AWESOME

I would like a --proxy command to use with http or socks proxy.

I know rclone support environment variables but it is not a viable option for me because I'm using Rclone with multiple providers and each time I set a proxy in a terminal, it affects the other terminal.

1 Like

I'm not sure why an environment variable would impact another terminal as I've never seen that.

Can you describe what you are doing and what OS you are using?

There is no real need for --proxy flag - the same functionality is provided by environment variables. Of course feel free to implement it if you prefer flag and post PR.

BTW environment variables do not have to be set system wide but can be set for specific command execution only:

VAR1=VALUE1 VAR2=VALUE2 ... Command ARG1 ARG2...

More info:

1 Like

I don’t get it either.

On windows command prompt or powershell

Set https_proxy=

After a while 1 of my rclone session loose connection to the proxy. I cannot be sure it logs to the other one set in other terminal, when I ran curl ipconfig.me only get a 401 move.

I am not windows user but I guess that env vars you set in different terminals have only local scope (session).

set proxy variable to value you want to use before invoking rclone - it would be the same with --proxy flag.

that does not sound quite correct.

  • set is for cmd
    set https_proxy=socks5://us-sjc-wg-socks5-105.relays.mullvad.net:1080
  • $env is for powershell
    $env:https_proxy=socks5://us-sjc-wg-socks5-105.relays.mullvad.net:1080

not sure what that means. variables are per session/terminal

and a while back, i did a testing with rclone and proxy.
https://forum.rclone.org/t/unable-to-use-proxy-in-windows-with-onedrive-remote/36092/5?u=asdffdsa

as an aside, this past week, i did a lot of testing running multiple proxy servers at the same time, using openvpn, wireguard, mullvad vpn+browser, firefox and so on.
always, each program would use a different proxy server, never once a problem.

and might follow this advice
https://rclone.org/faq/#can-i-use-rclone-with-an-http-proxy
"""
Slightly annoyingly, there is no standard for the name; some applications may use http_proxy but another one HTTP_PROXY. The Go libraries used by rclone will try both variations, but you may wish to set all possibilities.
"""

Thank you, I will try again and check your link

Of course it does.
The env var is used by looots of programs and libs.
Pythons urllib, curl, wget, majority of go programs and many more. You won't even be able to use github copilot since they block vpn/proxy.
Having another way to set a proxy without affecting other programs would be a huge advantage for some people.
It would also allow you to easily use different proxies when running multiple instances of rclone.
I haven't checked what go lib is used for network but I doubt it doesn't support an additional proxy parameter.

Of course what does? I am not sure what you are saying here.

Again, what?

My statement was when you set environment variables, they are used generally in a terminal you set them in. You "can" set them globally for all time but if that's not what you want, don't do that?

You can already do that with setting environment variables.

--proxy flag would be nice thing to have - it does not exist today. But it will not allow you to do anything beyond what can be done today using env vars. This is why it is "nice to have" feature but nothing critical or "must have"

hi, as the OP is on windows, env vars can be globally using setx

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.