Unable to use proxy in Windows with Onedrive remote

What is the problem you are having with rclone?

I have set the environment variables of http_proxy, https_proxy, HTTP_PROXY and HTTPS_PROXY to my proxy at socks5://127.0.0.1:10086 according to the FAQ, but they doesn't seem to be respected by rclone.

I have two interfaces, one with large download bandwidth but small upload bandwidth, the other has a normal download bandwidth and a large upload bandwidth. So the former is the one I primarily use and I depend on a socks5 proxy to specify the other interface when I need to do upload-intensive stuff. However, based on task manager, rclone is still using the interface for download despite the proxy settings when I run rclone copy -P some/large/file onedrive_remote:. I would expect at least for rclone to fail when I shutdown the proxy, but it doesn't, meaning that is never detects the proxy settings at all.

Run the command 'rclone version' and share the full output of the command.

rclone v1.61.1

  • os/version: Microsoft Windows 11 Pro 22H2 (64 bit)
  • os/kernel: 10.0.22621.1194 (x86_64)
  • os/type: windows
  • os/arch: amd64
  • go/version: go1.19.4
  • go/linking: static
  • go/tags: cmount

Which cloud storage system are you using? (eg Google Drive)

OneDrive business

The command you were trying to run (eg rclone copy /tmp remote:tmp)

rclone copy -P some/large/file onedrive_remote:

The rclone config contents with secrets removed.

[E5]
type = onedrive
token = <token>
drive_id = b!OCV3YdGyCUCSthg9OLMmkw5xjV39hptPhL1rrw-<mask>
drive_type = business

[Crypt]
type = crypt
remote = E5:Crypt
filename_encryption = off
directory_name_encryption = false
password = <password>

A log from the command with the -vv flag

2023/02/11 20:37:09 DEBUG : rclone: Version "v1.61.1" starting with parameters ["C:\\Users\\<username>\\scoop\\apps\\rclone\\current\\rclone.exe" "copy" "-P" "C:\\Users\\<username>\\some\\large\\file" "Crypt:" "-vv"]
2023/02/11 20:37:09 DEBUG : Creating backend with remote "C:\\Users\\<username>\\some\\large\\file"
2023/02/11 20:37:09 DEBUG : Using config file from "C:\\Users\\<username>\\scoop\\apps\\rclone\\current\\rclone.conf"
2023/02/11 20:37:09 DEBUG : fs cache: adding new entry for parent of "C:\\Users\\<username>\\some\\large\\file", "//?/C:/Users/<username>/Downloads"
2023/02/11 20:37:09 DEBUG : Creating backend with remote "Crypt:"
2023/02/11 20:37:09 DEBUG : Creating backend with remote "E5:Crypt"
2023-02-11 20:37:11 DEBUG : fle: Need to transfer - File not found at Destination
2023-02-11 20:37:11 DEBUG : fle.bin: Starting multipart upload
2023-02-11 20:37:12 DEBUG : fle.bin: Uploading segment 0/14139459936 size 10485760
2023-02-11 20:37:14 INFO  : Signal received: interrupt
2023-02-11 20:37:14 DEBUG : fle.bin: Cancelling multipart upload: <nil>
2023-02-11 20:37:15 INFO  : Exiting...
Transferred:        8.471 MiB / 13.165 GiB, 0%, 2.392 MiB/s, ETA 1h33m53s
Transferred:            0 / 1, 0%
Elapsed time:         5.5s
Transferring:
 * file:  0% /13.165Gi, 2.397Mi/s, 1h33m40s

hello and welcome to the forum,

might be that rclone does not support socks5,
https://github.com/rclone/rclone/issues/3558

So indeed rclone doesn't support socks5 yet? I have seem many contradicting information on this, e.g. someone first says socks5 isn't supported but someone else commented that it is supported in this thread, and in another thread, it says rclone doesn't implement proxies on their own and it should support socks5 because the go get library being used supports it, and the FAQ also indicates that socks5 as a proxy protocol is supported and I remember in one Github issue a member says the reason to explicitly specify protocol in the environment variable is that there are socks proxies other than http/https ones. I would suggest at least print something in the log if the specified proxy isn't supported.

Also, the issue you linked seems to be specific about FTP/SFTP remotes, while OneDrive should be using http//https, no? At least it's dumping a bunch of http headers when I use the --dump headers option.

Updates: Can confirm it's not a problem with the socks proxy. I created an http proxy instead, and still rclone isn't using it.

I finally figured it out. It's a problem with setting environment variables in powershell. The set command from cmd used to work but not any more. I have checked $Env:http_proxy and it's empty even when I just set it. So, what you should do is to use the native powershell way of setting the environment variable for the current session by $Env:http_proxy = "protocol://server:port". I would suggest using With-Env here to get a better experience of setting environment variable for the current command only like one tend to do in Linux.
Unfortunately, Onedrive doesn't seem to be maxing out my upload bandwidth though.

i just did a test to confirm, rclone does support socks5 proxy.
the documentation might need a tweak, to make that clear with an example.

set https_proxy=socks5://10.8.0.1:1080

well known in the forum, onedrive is one of the slowest providers.
what was the max bandwidth upload you got?

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