The protocol between our LB and jetty based http agent is a binary proprietary protocol (I can't provide here the exact binary content), and we can't use the jetty PROXY protocol between our LB and the http agents.
So, let me explain better our need: when an http agent sends a HTTP2 101 protocol switch to the LB, we need to send the "special message" to the LB (before the HTTP2 101). This "special message" is part of the proprietary protocol between the LB and the http agent, and is really similar to the 101 protocol switch: it just tells to the LB that a protocol switch will take place. We have to do this because the LB does not currently parse the real HTTP2 101 responded by jetty from the http agent.
There is actually a similar scenario when using Jetty Web Sockets: when a web socket client sends an initial request with some upgrade informations, then the jetty running inside the http agent sends a 101 http response in order to announce the switch to the Web Sockets protocol.
So, here we have the same need and we want to send the "special message" to the LB before the 101 is sent.
To do so, we are using the following trick which works for Web Sockets: we are attaching a RequestLogHandler to the org.eclipse.jetty.server.Server object (inside the http agent jvm), and when the 101 is about to be sent to the LB, our RequestLogHandler is first called and at this exact point, we are then sending the "special message" to the LB before the Web Socket 101 reponse is sent.
So, this does not seem to work in the context of HTTP2, and our RequestLogHandler is not called with the HTTP2 101 response. Is this something that is just impossible to do using HTTP2 ? If not, then we'll have to consider some other approach.
thanks for your patience ...
cheers;
/Pierre