Without an initial flush(), the JVM HttpServer buffers all
output until the first flush() in the 15-second keep-alive loop.
Clients with shorter timeouts (e.g. 10 s) abort before receiving
any data.
Add a flush() call directly after creating ServerSentEventSender,
before the wait loop, so the HTTP 200 response and headers reach the
client immediately upon connection.
Adds regression test SseInitialFlushTest that verifies at least one
byte arrives within 2 seconds of connecting to GET /api/v1/events.
So far it was doing an equals check, but a string like "application/json; charset=utf-8"
is similarly valid. And some clients like OkHttp actually automatically add the
charset.
Closes#1152
Adds a simple HTTP endpoint that can be used by the container
environment to see if the app is started and available.
Co-authored-by: cedb <cedb@keylimebox.org>
* Add initial proof of concept for http server
* Add support for registration commands
* Add support for MultiLocalCommands
* Improve handling of HTTP responses
Makes it so that responses area all uniformly JSON and wrapped
into the proper response envelope.
* Add caching for workflows
* Run http server with daemon command
This fits the existing command line API better
* Wrap the existing JSON RPC handler in HTTP Service
This is a redesign of earlier attempts to make an HTTP service. Fixing
that service turned out that it would have to be a copy of the
SignalJsonRpcDispatcherHandler. So instead of copy pasting all the
code the existing service is simply being wrapped.
* Switch http server to use command handler
* Clean up and simplification
* Pass full InetSocketAddress
* Minor fixes and improvements
Based on code review.
Co-authored-by: cedb <cedb@keylimebox.org>