Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] Modifying the HTTP/1.1 Response Status Line's HTTP Version indicator

Are you using the Jetty HttpClient and want to see these unsolicited HAP responses?
Or are you wanting to generate these unsolicited responses on the Jetty server side?

Using something newer then Jetty 9.3.x might be a better option.
Jetty 9.4.x, or if your schedule permits it, Jetty 10.0.x could bend/modify to support something like this (while Jetty 9.x is less flexible ATM).

Joakim Erdfelt / joakim@xxxxxxxxxxx


On Thu, Nov 7, 2019 at 10:57 AM Karel Goderis <karel.goderis@xxxxxx> wrote:
Hi all

I am implementing the Apple Home Accessory Protocol on top of Jetty 9.3.x. HAP defines a notification/eventing mechanism on top of HTTP

The spec states:

"The accessory delivers notifications by sending an event message, which is an unsolicited HTTP response, over the TCP connection established by the controller. An event message has the same format as an HTTP response, but uses an protocol version of EVENT/1.0.”

Question: how can the version indicator be changed?

My initial though was to write an extension of HttpConnection, and override newHttpGenerator() with a custom HttpGenerator (which is most probably a copy/past from Jetty's built-in HttpGenerator except for that fact that generateResponse() might use a different generateResponseLine() in function of the presence or absence of a to-be-defined X-... Header. I would set that Header in the Handler/Servlet's doHandle() whenever the protocol has to be “switched"

Thanks
Karel.
_______________________________________________
jetty-users mailing list
jetty-users@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/jetty-users

Back to the top