github.com/artpar/rclone@v1.67.3/docs/content/http.md (about) 1 --- 2 title: "HTTP Remote" 3 description: "Read only remote for HTTP servers" 4 versionIntroduced: "v1.37" 5 --- 6 7 # {{< icon "fa fa-globe" >}} HTTP 8 9 The HTTP remote is a read only remote for reading files of a 10 webserver. The webserver should provide file listings which rclone 11 will read and turn into a remote. This has been tested with common 12 webservers such as Apache/Nginx/Caddy and will likely work with file 13 listings from most web servers. (If it doesn't then please file an 14 issue, or send a pull request!) 15 16 Paths are specified as `remote:` or `remote:path`. 17 18 The `remote:` represents the configured [url](#http-url), and any path following 19 it will be resolved relative to this url, according to the URL standard. This 20 means with remote url `https://beta.rclone.org/branch` and path `fix`, the 21 resolved URL will be `https://beta.rclone.org/branch/fix`, while with path 22 `/fix` the resolved URL will be `https://beta.rclone.org/fix` as the absolute 23 path is resolved from the root of the domain. 24 25 If the path following the `remote:` ends with `/` it will be assumed to point 26 to a directory. If the path does not end with `/`, then a HEAD request is sent 27 and the response used to decide if it it is treated as a file or a directory 28 (run with `-vv` to see details). When [--http-no-head](#http-no-head) is 29 specified, a path without ending `/` is always assumed to be a file. If rclone 30 incorrectly assumes the path is a file, the solution is to specify the path with 31 ending `/`. When you know the path is a directory, ending it with `/` is always 32 better as it avoids the initial HEAD request. 33 34 To just download a single file it is easier to use 35 [copyurl](/commands/rclone_copyurl/). 36 37 ## Configuration 38 39 Here is an example of how to make a remote called `remote`. First 40 run: 41 42 rclone config 43 44 This will guide you through an interactive setup process: 45 46 ``` 47 No remotes found, make a new one? 48 n) New remote 49 s) Set configuration password 50 q) Quit config 51 n/s/q> n 52 name> remote 53 Type of storage to configure. 54 Choose a number from below, or type in your own value 55 [snip] 56 XX / HTTP 57 \ "http" 58 [snip] 59 Storage> http 60 URL of http host to connect to 61 Choose a number from below, or type in your own value 62 1 / Connect to example.com 63 \ "https://example.com" 64 url> https://beta.rclone.org 65 Remote config 66 -------------------- 67 [remote] 68 url = https://beta.rclone.org 69 -------------------- 70 y) Yes this is OK 71 e) Edit this remote 72 d) Delete this remote 73 y/e/d> y 74 Current remotes: 75 76 Name Type 77 ==== ==== 78 remote http 79 80 e) Edit existing remote 81 n) New remote 82 d) Delete remote 83 r) Rename remote 84 c) Copy remote 85 s) Set configuration password 86 q) Quit config 87 e/n/d/r/c/s/q> q 88 ``` 89 90 This remote is called `remote` and can now be used like this 91 92 See all the top level directories 93 94 rclone lsd remote: 95 96 List the contents of a directory 97 98 rclone ls remote:directory 99 100 Sync the remote `directory` to `/home/local/directory`, deleting any excess files. 101 102 rclone sync --interactive remote:directory /home/local/directory 103 104 ### Read only 105 106 This remote is read only - you can't upload files to an HTTP server. 107 108 ### Modification times 109 110 Most HTTP servers store time accurate to 1 second. 111 112 ### Checksum 113 114 No checksums are stored. 115 116 ### Usage without a config file 117 118 Since the http remote only has one config parameter it is easy to use 119 without a config file: 120 121 rclone lsd --http-url https://beta.rclone.org :http: 122 123 or: 124 125 rclone lsd :http,url='https://beta.rclone.org': 126 127 {{< rem autogenerated options start" - DO NOT EDIT - instead edit fs.RegInfo in backend/http/http.go then run make backenddocs" >}} 128 ### Standard options 129 130 Here are the Standard options specific to http (HTTP). 131 132 #### --http-url 133 134 URL of HTTP host to connect to. 135 136 E.g. "https://example.com", or "https://user:pass@example.com" to use a username and password. 137 138 Properties: 139 140 - Config: url 141 - Env Var: RCLONE_HTTP_URL 142 - Type: string 143 - Required: true 144 145 ### Advanced options 146 147 Here are the Advanced options specific to http (HTTP). 148 149 #### --http-headers 150 151 Set HTTP headers for all transactions. 152 153 Use this to set additional HTTP headers for all transactions. 154 155 The input format is comma separated list of key,value pairs. Standard 156 [CSV encoding](https://godoc.org/encoding/csv) may be used. 157 158 For example, to set a Cookie use 'Cookie,name=value', or '"Cookie","name=value"'. 159 160 You can set multiple headers, e.g. '"Cookie","name=value","Authorization","xxx"'. 161 162 Properties: 163 164 - Config: headers 165 - Env Var: RCLONE_HTTP_HEADERS 166 - Type: CommaSepList 167 - Default: 168 169 #### --http-no-slash 170 171 Set this if the site doesn't end directories with /. 172 173 Use this if your target website does not use / on the end of 174 directories. 175 176 A / on the end of a path is how rclone normally tells the difference 177 between files and directories. If this flag is set, then rclone will 178 treat all files with Content-Type: text/html as directories and read 179 URLs from them rather than downloading them. 180 181 Note that this may cause rclone to confuse genuine HTML files with 182 directories. 183 184 Properties: 185 186 - Config: no_slash 187 - Env Var: RCLONE_HTTP_NO_SLASH 188 - Type: bool 189 - Default: false 190 191 #### --http-no-head 192 193 Don't use HEAD requests. 194 195 HEAD requests are mainly used to find file sizes in dir listing. 196 If your site is being very slow to load then you can try this option. 197 Normally rclone does a HEAD request for each potential file in a 198 directory listing to: 199 200 - find its size 201 - check it really exists 202 - check to see if it is a directory 203 204 If you set this option, rclone will not do the HEAD request. This will mean 205 that directory listings are much quicker, but rclone won't have the times or 206 sizes of any files, and some files that don't exist may be in the listing. 207 208 Properties: 209 210 - Config: no_head 211 - Env Var: RCLONE_HTTP_NO_HEAD 212 - Type: bool 213 - Default: false 214 215 #### --http-description 216 217 Description of the remote 218 219 Properties: 220 221 - Config: description 222 - Env Var: RCLONE_HTTP_DESCRIPTION 223 - Type: string 224 - Required: false 225 226 ## Backend commands 227 228 Here are the commands specific to the http backend. 229 230 Run them with 231 232 rclone backend COMMAND remote: 233 234 The help below will explain what arguments each command takes. 235 236 See the [backend](/commands/rclone_backend/) command for more 237 info on how to pass options and arguments. 238 239 These can be run on a running backend using the rc command 240 [backend/command](/rc/#backend-command). 241 242 ### set 243 244 Set command for updating the config parameters. 245 246 rclone backend set remote: [options] [<arguments>+] 247 248 This set command can be used to update the config parameters 249 for a running http backend. 250 251 Usage Examples: 252 253 rclone backend set remote: [-o opt_name=opt_value] [-o opt_name2=opt_value2] 254 rclone rc backend/command command=set fs=remote: [-o opt_name=opt_value] [-o opt_name2=opt_value2] 255 rclone rc backend/command command=set fs=remote: -o url=https://example.com 256 257 The option keys are named as they are in the config file. 258 259 This rebuilds the connection to the http backend when it is called with 260 the new parameters. Only new parameters need be passed as the values 261 will default to those currently in use. 262 263 It doesn't return anything. 264 265 266 {{< rem autogenerated options stop >}} 267 268 ## Limitations 269 270 `rclone about` is not supported by the HTTP backend. Backends without 271 this capability cannot determine free space for an rclone mount or 272 use policy `mfs` (most free space) as a member of an rclone union 273 remote. 274 275 See [List of backends that do not support rclone about](https://rclone.org/overview/#optional-features) and [rclone about](https://rclone.org/commands/rclone_about/) 276