View | Details | Raw Unified | Return to bug 61759
Collapse All | Expand All

(-)usr.bin/fetch/fetch.1.newer (-12 / +108 lines)
Lines 214-233 Link Here
214
will attempt to retrieve them each of them in turn, and return zero
214
will attempt to retrieve them each of them in turn, and return zero
215
only if they were all successfully retrieved.
215
only if they were all successfully retrieved.
216
.Sh ENVIRONMENT
216
.Sh ENVIRONMENT
217
.Bl -tag -width HTTP_TIMEOUT
217
.Bl -tag -width ".Ev FETCH_BIND_ADDRESS"
218
.It Ev FTP_TIMEOUT
218
.It Ev FETCH_BIND_ADDRESS
219
maximum time, in seconds, to wait before aborting an
219
Specifies a hostname or IP address to which sockets used for outgoing
220
.Tn FTP
220
connections will be bound.
221
connection.
221
.It Ev FTP_LOGIN
222
.It Ev HTTP_TIMEOUT
222
Default FTP login if none was provided in the URL.
223
maximum time, in seconds, to wait before aborting an
223
.It Ev FTP_PASSIVE_MODE
224
.Tn HTTP
224
If set to anything but
225
connection.
225
.Ql no ,
226
forces the FTP code to use passive mode.
227
.It Ev FTP_PASSWORD
228
Default FTP password if the remote server requests one and none was
229
provided in the URL.
230
.It Ev FTP_PROXY
231
URL of the proxy to use for FTP requests.
232
The document part is ignored.
233
FTP and HTTP proxies are supported; if no scheme is specified, FTP is
234
assumed.
235
If the proxy is an FTP proxy,
236
.Nm fetch
237
will send
238
.Ql user@host
239
as user name to the proxy, where
240
.Ql user
241
is the real user name, and
242
.Ql host
243
is the name of the FTP server.
244
.Pp
245
If this variable is set to an empty string, no proxy will be used for
246
FTP requests, even if the
247
.Ev HTTP_PROXY
248
variable is set.
249
.It Ev ftp_proxy
250
Same as
251
.Ev FTP_PROXY ,
252
for compatibility.
253
.It Ev HTTP_AUTH
254
Specifies HTTP authorization parameters as a colon-separated list of
255
items.
256
The first and second item are the authorization scheme and realm
257
respectively; further items are scheme-dependent.
258
Currently, only basic authorization is supported.
259
.Pp
260
Basic authorization requires two parameters: the user name and
261
password, in that order.
262
.Pp
263
This variable is only used if the server requires authorization and
264
no user name or password was specified in the URL.
265
.It Ev HTTP_PROXY
266
URL of the proxy to use for HTTP requests.
267
The document part is ignored.
268
Only HTTP proxies are supported for HTTP requests.
269
If no port number is specified, the default is 3128.
270
.Pp
271
Note that this proxy will also be used for FTP documents, unless the
272
.Ev FTP_PROXY
273
variable is set.
274
.It Ev http_proxy
275
Same as
276
.Ev HTTP_PROXY ,
277
for compatibility.
278
.It Ev HTTP_PROXY_AUTH
279
Specifies authorization parameters for the HTTP proxy in the same
280
format as the
281
.Ev HTTP_AUTH
282
variable.
283
.Pp
284
This variable is used if and only if connected to an HTTP proxy, and
285
is ignored if a user and/or a password were specified in the proxy
286
URL.
287
.It Ev HTTP_REFERER
288
Specifies the referrer URL to use for HTTP requests.
289
If set to
290
.Dq auto ,
291
the document URL will be used as referrer URL.
292
.It Ev HTTP_USER_AGENT
293
Specifies the User-Agent string to use for HTTP requests.
294
This can be useful when working with HTTP origin or proxy servers that
295
differentiate between user agents.
296
.It Ev NETRC
297
Specifies a file to use instead of
298
.Pa ~/.netrc
299
to look up login names and passwords for FTP sites.
300
See
301
.Xr ftp 1
302
for a description of the file format.
303
This feature is experimental.
226
.El
304
.El
305
.Sh EXAMPLES
306
To access a proxy server on
307
.Pa proxy.example.com
308
port 8080, set the
309
.Ev HTTP_PROXY
310
environment variable in a manner similar to this:
311
.Pp
312
.Dl HTTP_PROXY=http://proxy.example.com:8080
313
.Pp
314
If the proxy server requires authentication, there are
315
two options available for passing the authentication data.
316
The first method is by using the proxy URL:
317
.Pp
318
.Dl HTTP_PROXY=http://<user>:<pwd>@proxy.example.com:8080
227
.Pp
319
.Pp
228
All environment variables mentioned in the documentation for the
320
The second method is by using the
229
.Xr fetch 3
321
.Ev HTTP_PROXY_AUTH
230
library are supported.
322
environment variable:
323
.Bd -literal -offset indent
324
HTTP_PROXY=http://proxy.example.com:8080
325
HTTP_PROXY_AUTH=basic:*:<user>:<pwd>
326
.Ed
231
.Sh SEE ALSO
327
.Sh SEE ALSO
232
.Xr fetch 3
328
.Xr fetch 3
233
.Sh HISTORY
329
.Sh HISTORY

Return to bug 61759