You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

161 lines
3.9KB

  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.
  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 \-\-username " " \fIUSERNAME\fR
  70. Username for basic authentication.
  71. Can also be specified with the environment variable NODE_HTTP_SERVER_USERNAME.
  72. Defaults to none.
  73. .TP
  74. .BI \-\-password " " \fIPASSWORD\fR
  75. Password for basic authentication.
  76. Can also be specified with the environment variable NODE_HTTP_SERVER_PASSWORD.
  77. Defaults to none.
  78. .TP
  79. .BI \-S ", " \-\-ssl
  80. Enable https.
  81. .TP
  82. .BI \-C ", " \-\-cert " " [\fIFILE\fR]
  83. Path to SSL certificate file.
  84. If not specified, uses cert.pem.
  85. .TP
  86. .BI \-K ", " \-\-key " " [\fIFILE\fR]
  87. Path to SSL key file.
  88. If not specified, uses key.pem.
  89. .TP
  90. .BI \-r ", " \-\-robots " " [\fIUSER\-AGENT\fR]
  91. Respond to /robots.txt request.
  92. If not specified, uses "User-agent: *\\nDisallow: /]"
  93. .TP
  94. .BI \-\-no\-dotfiles
  95. Do not show dotfiles.
  96. .TP
  97. .BI \-h ", " \-\-help
  98. Print usage and exit.
  99. .TP
  100. .BI \-v ", " \-\-version
  101. Print version and exit.
  102. .SH FILES
  103. .B index.html
  104. will be served as the default file to any directory requests.
  105. .B 404.html
  106. will be served if a file is not found. This can be used for SPA hosting to serve the entry page.
  107. .SH COPYING
  108. Copyright (c) 2011-2020 Charlie Robbins, Marak Squires, and the Contributors.
  109. Permission is hereby granted, free of charge, to any person obtaining
  110. a copy of this software and associated documentation files (the
  111. "Software"), to deal in the Software without restriction, including
  112. without limitation the rights to use, copy, modify, merge, publish,
  113. distribute, sublicense, and/or sell copies of the Software, and to
  114. permit persons to whom the Software is furnished to do so, subject to
  115. the following conditions:
  116. The above copyright notice and this permission notice shall be
  117. included in all copies or substantial portions of the Software.
  118. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  119. EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  120. MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  121. NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
  122. LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
  123. OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  124. WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  125. .SH VERSION
  126. Version 0.12.2