1. 21 Feb, 2022 2 commits
  2. 23 Dec, 2021 1 commit
  3. 30 Nov, 2021 1 commit
  4. 08 Nov, 2021 1 commit
  5. 06 Nov, 2021 1 commit
  6. 19 Apr, 2021 1 commit
  7. 07 Feb, 2021 2 commits
  8. 27 Jan, 2021 3 commits
    • Phil Jones's avatar
      Fix latest mypy release issues · 3714b5c7
      Phil Jones authored
      It seems to have not recognised these files before now, mypy relase
      0.800.
      3714b5c7
    • Phil Jones's avatar
      Correctly utilise SCRIPT_NAME in the wsgi middleware · 20f223e8
      Phil Jones authored
      If a root_path (WSGI SCRIPT_NAME) is specified the server should
      return 404 to any requests that have a path that do not start with the
      SCRIPT_NAME. The server should also adjust the path to remove the
      SCRIPT_NAME, whilst keeping the raw_path intact.
      
      This allows the SCRIPT_NAME to be used as a global prefix to all
      routes served using the WSGI middleware.
      20f223e8
    • Phil Jones's avatar
      Revert "Bugfix the root_path handling" · 08c948df
      Phil Jones authored
      This reverts commit c9dd670e.
      
      The ASGI spec is quite clear that this isn't how it should work for
      ASGI, rather this functionality should be part of any ASGI application
      code.
      08c948df
  9. 21 Jan, 2021 1 commit
    • Phil Jones's avatar
      Bugfix the root_path handling · c9dd670e
      Phil Jones authored
      If a root_path is specified the server should return 404 to any
      requests that have a path that do not start with the root_path. The
      server should also adjust the path to remove the root_path, whilst
      keeping the raw_path intact.
      
      This allows the root_path to be used as a global prefix to all routes
      served.
      c9dd670e
  10. 05 Oct, 2020 1 commit
    • Phil Jones's avatar
      Bugfix logging · 4068c4ef
      Phil Jones authored
      This reverts recent changes, and simplifies the logging configuration
      to work as expected. This hopefully now works correctly in all cases.
      4068c4ef
  11. 26 Sep, 2020 4 commits
    • Peter Smith's avatar
      Add a warning for UNIX QUIC sockets · ec294bab
      Peter Smith authored
      Since "alt-svc" cannot be used to redirect to these sockets, they may
      not be used.
      ec294bab
    • Peter Smith's avatar
      Get QUIC socket addresses from themselves · f038f9e5
      Peter Smith authored
      Since `--bind-quic` may contain a combination of IP addresses, UNIX
      socket addresses and file descriptor numbers, we cannot use it to
      directly to get port numbers to send in a "alt-svc" header. Instead
      once all of the sockets have been assembled, query each in turn for its
      own address and filter out UNIX addresses.
      f038f9e5
    • Peter Smith's avatar
      Add socket type check · b3194de8
      Peter Smith authored
      b3194de8
    • Peter Smith's avatar
      Handle sockets given as file descriptors properly · 9690f8c6
      Peter Smith authored
      Currently file descriptors are converted into python sockets using
      `socket.fromfd`, this method has two flaws. The first is that it
      duplicates the file descriptor, this results in a dangling file
      descriptor which is left behind if it is not manually closed. Secondly
      it requires passing the socket type and family, of which we have no
      knowledge of and are left to give some defaults which are likely to be
      wrong. Instead of this, `socket.socket(fileno=fd)` can be used. This
      adopts the file descriptor rather than closing it and infers the socket
      parameters.
      9690f8c6
  12. 13 Sep, 2020 1 commit
    • Phil Jones's avatar
      Change configuration loading for python files · ab0f6b6f
      Phil Jones authored
      Previously using the `python:` prefix on the command line would load a
      python file path, this is now achieved via the `file:` prefix. The
      `python:` prefix now loads a python module. this matches Gunicorn and
      removes a source of confusion.
      ab0f6b6f
  13. 29 Aug, 2020 1 commit
  14. 04 Jun, 2020 2 commits
    • Phil Jones's avatar
      Add a graceful timeout on shutdown · 241d9786
      Phil Jones authored
      This should give any tasks (requests, or background) the graceful
      timeout to finish before they are cancelled. Note that this timeout is
      before the lifespan shutdown timeout.
      241d9786
    • Phil Jones's avatar
      Add the ability to send websocket pings · 4a884dbf
      Phil Jones authored
      This allows the connection to be kept alive (busy) until either the
      client disconnects or the ASGI app decides to close the connection.
      This helps, for example, when Hypercorn is used behind Nginx and Nginx
      decides that the connection is not alive based on usage.
      4a884dbf
  15. 01 Jun, 2020 1 commit
    • Phil Jones's avatar
      Add support for server names · f2886754
      Phil Jones authored
      This allows the valid hosts to be configured and for Hypercorn to only
      reply to these hosts (404s to others). This helps mitigate DNS
      rebinding attacks.
      
      As Hypercorn is often used without a server name validating proxy (for
      HTTP/2 and HTTP/3) it makes sense for this functionality to be in
      Hypercorn.
      
      I'm unsure what the best default is, I think there is a case for the
      secure default to require server names to be set. However I think this
      is too restrictive to the actual use cases.
      f2886754
  16. 24 Feb, 2020 1 commit
  17. 02 Feb, 2020 1 commit
  18. 17 Jan, 2020 1 commit
    • Phil Jones's avatar
      Move source to the src directory · 6f243df8
      Phil Jones authored
      This is to ensure that the setup works correctly, and follows a trend
      in the Python community of moving code to within a src directory -
      particularly as Quart has done so.
      6f243df8
  19. 25 Oct, 2019 1 commit
  20. 09 Oct, 2019 1 commit
    • Phil Jones's avatar
      Allow the Alt-Svc headers to be configured · e3ffc310
      Phil Jones authored
      If specified the configured Alt-Svc headers are used in preference to
      auto generated ones. This allows for port remapping whereby Hypercorn
      is not aware that the service is exposed on a different port to the
      one Hypercorn is serving on.
      
      This is a provisional API, I expect for a better version to become
      apparent in time.
      e3ffc310
  21. 04 Oct, 2019 2 commits
  22. 25 Sep, 2019 1 commit
  23. 22 Sep, 2019 1 commit
  24. 29 Aug, 2019 1 commit
  25. 26 Aug, 2019 1 commit
  26. 25 Aug, 2019 1 commit
    • Phil Jones's avatar
      Add the ability to change permissions and ownerships of unix sockets · 72b2ca07
      Phil Jones authored
      An example of how this is useful is to consider using Hypercorn with
      nginx where nginx is configured to use an upstream socket. In this
      case nginx is often configured to run as another user, which will not
      be able to read the Hypercorn created socket. Hence telling Hypercorn
      to change the ownership helps.
      
      Note this contains a usage update for the quic binds (this was missed
      previously).
      72b2ca07
  27. 11 Aug, 2019 1 commit
    • Phil Jones's avatar
      Initially support HTTP/3 · 7c1f519f
      Phil Jones authored
      This is still a work in progress and hence is not enabled by default,
      instead hypercorn will need to be installed with the extra ``h3`` e.g.
      ``pip install hypercorn[h3]``.
      
      This makes use of the aioquic library as the sans-io library for the
      QUIC and HTTP/3 protocols.
      7c1f519f
  28. 08 Jul, 2019 1 commit
  29. 04 Jul, 2019 1 commit
    • Phil Jones's avatar
      Add the ability to log metrics to statsd · 1649c331
      Phil Jones authored
      This follows the same interface as Gunicorn and reports the same
      metrics. It should allow better monitoring of Hypercorn servers.
      
      Note that the UDP socket is dependent upon the event loop and requires
      the interface to change to be async.
      1649c331
  30. 30 Jun, 2019 2 commits
    • Phil Jones's avatar
      Allow the server header to be omitted · 70be2ac5
      Phil Jones authored
      This adds a config option ``include_server_header`` which can be set
      to False in order to prevent Hypercorn from adding the server
      header. Additionally the config ``response_headers`` method can be
      overidden in order to fully control headers added by Hypercorn.
      
      This is often desired to obfuscate the server version in the hope it
      improves security.
      70be2ac5
    • Phil Jones's avatar
      Support literal IPv6 addresses (square brackets) · 87b6d208
      Phil Jones authored
      This allows a bind to be [::]:0 rather than :::0, in addition it
      outputs IPv6 bins in the literal format.
      87b6d208