cowboy_protocol.ezdoc 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. ::: cowboy_protocol
  2. The `cowboy_protocol` module implements HTTP/1.1 and HTTP/1.0
  3. as a Ranch protocol.
  4. :: Types
  5. : opts() = [{compress, boolean()}
  6. | {env, cowboy_middleware:env()}
  7. | {max_empty_lines, non_neg_integer()}
  8. | {max_header_name_length, non_neg_integer()}
  9. | {max_header_value_length, non_neg_integer()}
  10. | {max_headers, non_neg_integer()}
  11. | {max_keepalive, non_neg_integer()}
  12. | {max_request_line_length, non_neg_integer()}
  13. | {middlewares, [module()]}
  14. | {onresponse, cowboy:onresponse_fun()}
  15. | {timeout, timeout()}]
  16. Configuration for the HTTP protocol handler.
  17. This configuration is passed to Cowboy when starting listeners
  18. using `cowboy:start_http/4` or `cowboy:start_https/4` functions.
  19. It can be updated without restarting listeners using the
  20. Ranch functions `ranch:get_protocol_options/1` and
  21. `ranch:set_protocol_options/2`.
  22. :: Option descriptions
  23. The default value is given next to the option name.
  24. : compress (false)
  25. When enabled, Cowboy will attempt to compress the response body.
  26. : env ([{listener, Ref}])
  27. Initial middleware environment.
  28. : max_empty_lines (5)
  29. Maximum number of empty lines before a request.
  30. : max_header_name_length (64)
  31. Maximum length of header names.
  32. : max_header_value_length (4096)
  33. Maximum length of header values.
  34. : max_headers (100)
  35. Maximum number of headers allowed per request.
  36. : max_keepalive (100)
  37. Maximum number of requests allowed per connection.
  38. : max_request_line_length (4096)
  39. Maximum length of the request line.
  40. : middlewares ([cowboy_router, cowboy_handler])
  41. List of middlewares to execute for every requests.
  42. : onresponse (undefined)
  43. Fun called every time a response is sent.
  44. : timeout (5000)
  45. Time in ms with no requests before Cowboy closes the connection.