http-server.1 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. .TH http-server 1 "April 2020" GNU "http-server man page"
  2. .SH NAME
  3. http-server \- a simple zero-configuration command-line http server
  4. .SH SYNOPSIS
  5. .B http-server
  6. [\fIPATH\fR]
  7. [\fIOPTIONS\fR]
  8. .SH DESCRIPTION
  9. \fBhttp-server\fR is a simple, zero-configuration command-line http server. It is powerful enough for production usage, but it's simple and hackable enough to be used for testing, local development, and learning.
  10. .SH OPTIONS
  11. .TP
  12. .BI [\fIPATH\fR]
  13. The directory to serve.
  14. Defaults to ./public if it exists, and ./ otherwise.
  15. .TP
  16. .BI \-p ", " \-\-port " " \fIPORT\fR
  17. Port to use. If 0, look for the first available port, starting at 8080.
  18. Default is 8080.
  19. .TP
  20. .BI \-a " " \fIADDRESS\fR
  21. Address to use.
  22. Default is 0.0.0.0.
  23. .TP
  24. .BI \-d
  25. Show directory listings.
  26. Default is true.
  27. .TP
  28. .BI \-i
  29. Display autoIndex.
  30. Default is true.
  31. .TP
  32. .BI \-g ", " \-\-gzip
  33. Serve gzip files when possible.
  34. Default is false.
  35. .TP
  36. .BI \-b ", " \-\-brotli
  37. Serve brotli files when possible.
  38. If both brotli and gzip are enabled, brotli takes precedence.
  39. Default is false.
  40. .TP
  41. .BI \-e ", " \-\-ext " " \fIEXTENSION\fR
  42. Default file extension is none is provided.
  43. .TP
  44. .BI \-s ", " \-\-silent
  45. Suppress log messages from output.
  46. .TP
  47. .BI \-\-cors " " [\fIHEADERS\fR]
  48. Enable CORS via the "Access-Control-Allow-Origin" header.
  49. Optionally provide CORS headers list separated by commas.
  50. .TP
  51. .BI \-o " " [\fIPATH\fR]
  52. Open default browser window after starting the server.
  53. Optionally provide a URL path to open the browser window to.
  54. .TP
  55. .BI \-c " " \fITIME\fR
  56. Cache time (max-age) in seconds.
  57. To disable caching, use \-c \-1.
  58. Default is 3600.
  59. .TP
  60. .BI \-U ", " \-\-utc
  61. Use UTC time format in log messages.
  62. .TP
  63. .BI \-\-log\-ip
  64. Enable logging of the client IP address.
  65. .TP
  66. .BI \-P ", " \-\-proxy
  67. Fallback proxy if the request cannot be resolved.
  68. .TP
  69. .BI \-\-proxy\-options
  70. Pass proxy options using nested dotted objects.
  71. .TP
  72. .BI \-\-username " " \fIUSERNAME\fR
  73. Username for basic authentication.
  74. Can also be specified with the environment variable NODE_HTTP_SERVER_USERNAME.
  75. Defaults to none.
  76. .TP
  77. .BI \-\-password " " \fIPASSWORD\fR
  78. Password for basic authentication.
  79. Can also be specified with the environment variable NODE_HTTP_SERVER_PASSWORD.
  80. Defaults to none.
  81. .TP
  82. .BI \-S ", " \-\-tls ", " \-\-ssl
  83. Enable https.
  84. .TP
  85. .BI \-C ", " \-\-cert " " [\fIFILE\fR]
  86. Path to SSL certificate file.
  87. If not specified, uses cert.pem.
  88. .TP
  89. .BI \-K ", " \-\-key " " [\fIFILE\fR]
  90. Path to SSL key file.
  91. If not specified, uses key.pem.
  92. Passphrase will be read from NODE_HTTP_SERVER_SSL_PASSPHRASE (if set)
  93. .TP
  94. .BI \-r ", " \-\-robots " " [\fIUSER\-AGENT\fR]
  95. Respond to /robots.txt request.
  96. If not specified, uses "User-agent: *\\nDisallow: /]"
  97. .TP
  98. .BI \-\-no\-dotfiles
  99. Do not show dotfiles.
  100. .TP
  101. .BI \-h ", " \-\-help
  102. Print usage and exit.
  103. .TP
  104. .BI \-v ", " \-\-version
  105. Print version and exit.
  106. .SH FILES
  107. .B index.html
  108. will be served as the default file to any directory requests.
  109. .B 404.html
  110. will be served if a file is not found. This can be used for SPA hosting to serve the entry page.
  111. .SH COPYING
  112. Copyright (c) 2011-2020 Charlie Robbins, Marak Squires, and the Contributors.
  113. Permission is hereby granted, free of charge, to any person obtaining
  114. a copy of this software and associated documentation files (the
  115. "Software"), to deal in the Software without restriction, including
  116. without limitation the rights to use, copy, modify, merge, publish,
  117. distribute, sublicense, and/or sell copies of the Software, and to
  118. permit persons to whom the Software is furnished to do so, subject to
  119. the following conditions:
  120. The above copyright notice and this permission notice shall be
  121. included in all copies or substantial portions of the Software.
  122. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  123. EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  124. MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  125. NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
  126. LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
  127. OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  128. WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  129. .SH VERSION
  130. Version 0.12.2