| Qore HttpServerUtil Module Reference 1.0

HttpServerUtil Module

# HttpServerUtil Introduction

The HttpServerUtil module provides a base code for the HttpServer module and code requiring HttpServer definitions but not the entire HttpServer module itself.

To use this module, use `"%requires HttpServerUtil"` in your code.

All the public symbols in the module are defined in the HttpServer namespace

The main classes are:

- AbstractAuthenticator: can be implemented to provide authentication and authorization info to the server
- AbstractHttpRequestHandler: this class must be subclassed to provide the real work of the HttpServer handling connections
- AbstractHttpSocketHandler: this class must be subclassed to implement a dedicated socket handler for protcol changes (for an example, see the WebSocketHandler module)
- AbstractLogger: this abstract class provides an interface for classes providing basic logging methods
- AbstractStreamRequest: this class is used to directly handle HTTP chunked requests and responses
- AbstractUrlHandler: this class serves as a base class for handler classes that serve requests anchored at a particular URL
- HttpListenerInterface: this abstract class provides the interface for the private HttpListener class implemented in the HttpServer module
- PermissiveAuthenticator: this class implements a dummy authenticator that accepts all requests

See also:

- RestHandler: a module providing a handler framework for this module for implementing server-side REST services
- WebSocketHandler: a module providing a handler framework for this module for implementing server-side WebSocket services
- WebUtil: a module providing higher-level HTTP services using this module as a base as well as providing support for dynamic template-based HTML rendering (ie rendering qhtml files which are a mix of HTML and Qore code)
- JsonRpcHandler: provides infrastructure for implementing JSON-RPC server-side services using the HttpServer module
- YamlRpcHandler: provides infrastructure for implementing YAML-RPC server-side services using the HttpServer module
- XmlRpcHandler: provides infrastructure for implementing XML-RPC server-side services using the HttpServer module
- SoapHandler: provides infrastructure for implementing SOAP server-side services using the HttpServer module

# HttpServerUtil Module Release Notes

## HttpServerUtil 1.0

- fixed a bug handling wildcard address binds in http_get_url_from_bind() (issue 4266)
- added a definition for the `308 Permanent Redirect` response (issue 4169)
- added support for the Logger module for logging (issue 4157)

## HttpServerUtil 0.9.11

- fixed a bug where it was not possible to include CORS headers or any context-sensitive information in a 401 response (issue 4136)
- fixed a bug that left hanging threads in HTTP operations with I/O callbacks with `HEAD` requests and a `Transfer-Encoding: chunked` header in the response (issue 4109)

## HttpServerUtil 0.9.5

- aligned version with the HttpServer module version

## HttpServerUtil 0.9.4

- added support for sending chunked replies from an InputStream (issue 3702)

## HttpServerUtil 0.3.12.1

- improved sensitive data masking in log messages (issue 2621)

## HttpServerUtil 0.3.12

- fixed a bug in AbstractAuthenticator::do401() where the msg argument was ignored (issue 1047)
- added logic to allow sensitive data to be masked in log messages (issue 1086)
- updated for complex types (issue 1724)
- moved HttpServer::parse_uri_query() to the Util module

## HttpServerUtil 0.3.11.2

- eliminated excess logging of each HTTP chunk sent or received

## HttpServerUtil 0.3.11.1

- aligned version with HttpServer module version

## HttpServerUtil 0.3.11

- initial version of the module
- implemented support for notifying persistent connections when the connection is terminated while a persistent connection is in place
- removed unused AbstractStreamRequestHandler class
- fixed HttpServer::parse_uri_query() to always return params as a hash (issue 569)
- added `root_path` to the context hash if the path was matched by a URL path prefix (issue 570)
- implemented support for custom timeout values in stream handlers (issue 719)