github.com/xhghs/rclone@v1.51.1-0.20200430155106-e186a28cced8/docs/content/http.md (about) 1 --- 2 title: "HTTP Remote" 3 description: "Read only remote for HTTP servers" 4 date: "2017-06-19" 5 --- 6 7 <i class="fa fa-globe"></i> HTTP 8 ------------------------------------------------- 9 10 The HTTP remote is a read only remote for reading files of a 11 webserver. The webserver should provide file listings which rclone 12 will read and turn into a remote. This has been tested with common 13 webservers such as Apache/Nginx/Caddy and will likely work with file 14 listings from most web servers. (If it doesn't then please file an 15 issue, or send a pull request!) 16 17 Paths are specified as `remote:` or `remote:path/to/dir`. 18 19 Here is an example of how to make a remote called `remote`. First 20 run: 21 22 rclone config 23 24 This will guide you through an interactive setup process: 25 26 ``` 27 No remotes found - make a new one 28 n) New remote 29 s) Set configuration password 30 q) Quit config 31 n/s/q> n 32 name> remote 33 Type of storage to configure. 34 Choose a number from below, or type in your own value 35 [snip] 36 XX / http Connection 37 \ "http" 38 [snip] 39 Storage> http 40 URL of http host to connect to 41 Choose a number from below, or type in your own value 42 1 / Connect to example.com 43 \ "https://example.com" 44 url> https://beta.rclone.org 45 Remote config 46 -------------------- 47 [remote] 48 url = https://beta.rclone.org 49 -------------------- 50 y) Yes this is OK 51 e) Edit this remote 52 d) Delete this remote 53 y/e/d> y 54 Current remotes: 55 56 Name Type 57 ==== ==== 58 remote http 59 60 e) Edit existing remote 61 n) New remote 62 d) Delete remote 63 r) Rename remote 64 c) Copy remote 65 s) Set configuration password 66 q) Quit config 67 e/n/d/r/c/s/q> q 68 ``` 69 70 This remote is called `remote` and can now be used like this 71 72 See all the top level directories 73 74 rclone lsd remote: 75 76 List the contents of a directory 77 78 rclone ls remote:directory 79 80 Sync the remote `directory` to `/home/local/directory`, deleting any excess files. 81 82 rclone sync remote:directory /home/local/directory 83 84 ### Read only ### 85 86 This remote is read only - you can't upload files to an HTTP server. 87 88 ### Modified time ### 89 90 Most HTTP servers store time accurate to 1 second. 91 92 ### Checksum ### 93 94 No checksums are stored. 95 96 ### Usage without a config file ### 97 98 Since the http remote only has one config parameter it is easy to use 99 without a config file: 100 101 rclone lsd --http-url https://beta.rclone.org :http: 102 103 <!--- autogenerated options start - DO NOT EDIT, instead edit fs.RegInfo in backend/http/http.go then run make backenddocs --> 104 ### Standard Options 105 106 Here are the standard options specific to http (http Connection). 107 108 #### --http-url 109 110 URL of http host to connect to 111 112 - Config: url 113 - Env Var: RCLONE_HTTP_URL 114 - Type: string 115 - Default: "" 116 - Examples: 117 - "https://example.com" 118 - Connect to example.com 119 - "https://user:pass@example.com" 120 - Connect to example.com using a username and password 121 122 ### Advanced Options 123 124 Here are the advanced options specific to http (http Connection). 125 126 #### --http-headers 127 128 Set HTTP headers for all transactions 129 130 Use this to set additional HTTP headers for all transactions 131 132 The input format is comma separated list of key,value pairs. Standard 133 [CSV encoding](https://godoc.org/encoding/csv) may be used. 134 135 For example to set a Cookie use 'Cookie,name=value', or '"Cookie","name=value"'. 136 137 You can set multiple headers, eg '"Cookie","name=value","Authorization","xxx"'. 138 139 140 - Config: headers 141 - Env Var: RCLONE_HTTP_HEADERS 142 - Type: CommaSepList 143 - Default: 144 145 #### --http-no-slash 146 147 Set this if the site doesn't end directories with / 148 149 Use this if your target website does not use / on the end of 150 directories. 151 152 A / on the end of a path is how rclone normally tells the difference 153 between files and directories. If this flag is set, then rclone will 154 treat all files with Content-Type: text/html as directories and read 155 URLs from them rather than downloading them. 156 157 Note that this may cause rclone to confuse genuine HTML files with 158 directories. 159 160 - Config: no_slash 161 - Env Var: RCLONE_HTTP_NO_SLASH 162 - Type: bool 163 - Default: false 164 165 #### --http-no-head 166 167 Don't use HEAD requests to find file sizes in dir listing 168 169 If your site is being very slow to load then you can try this option. 170 Normally rclone does a HEAD request for each potential file in a 171 directory listing to: 172 173 - find its size 174 - check it really exists 175 - check to see if it is a directory 176 177 If you set this option, rclone will not do the HEAD request. This will mean 178 179 - directory listings are much quicker 180 - rclone won't have the times or sizes of any files 181 - some files that don't exist may be in the listing 182 183 184 - Config: no_head 185 - Env Var: RCLONE_HTTP_NO_HEAD 186 - Type: bool 187 - Default: false 188 189 <!--- autogenerated options stop -->