Skip to content

3.0.0 Beta 8

Pre-release
Pre-release
Compare
Choose a tag to compare
@trowski trowski released this 22 Apr 14:48
· 40 commits to 3.x since this release
v3.0.0-beta.8
b86f0d4
  • Added two static constructors for SocketHttpServer
    • createForDirectAccess() — Creates an instance appropriate for direct access by the public
    • createForBehindProxy() — Creates an instance appropriate for use when behind a proxy service such as nginx'
  • The constructor of SocketHttpServer has changed to require an instance of ServerSocketFactory and ClientFactory, as well as accepting an array of middleware and a list of allowed HTTP methods. Use SocketHttpServer::createForDirectAccess() to create a server with similar defaults as the previous constructor.
  • Added ForwardedMiddleware and associated Forwarded class and ForwardedHeaderType enum. This middleware parses either Forwarded or X-Forwarded-For headers to determine the original client address when used behind a proxy supporting these headers.
  • Added AllowedMethodsMiddleware which limits the allowed HTTP verbs used by requests. This middleware is used automatically by SocketHttpServer. The allowed methods can be specified through a constructor parameter, using null to disable the middleware.
  • Removed the $allowedMethods argument from the constructors of HttpDriverFactory, Http1Driver, and Http2Driver since this functionality is now handled by the middleware above.
  • Added query-related methods to Request to get individual query keys in a manner similar to headers.