Here's what I discovered:
- In Http2ReceiveListener, there's code that refuses requests that don't have path set (with "No :path header sent in HTTP/2 request"). However, path must be omitted with CONNECT per https://tools.ietf.org/html/rfc7540#page-64
- Later on, ConnectHandler doesn't expect the path to be null.
- The acceptConnectRequest handler from https://github.com/undertow-io/undertow/blob/master/core/src/main/java/io/undertow/server/handlers/ConnectHandler.java
is not getting called and the connection is thus not setup. This is because Http2ServerConnection#setConnectListener doesn't do anything, unlike its counterpart HttpServerConnection.
For context, I was playing with the idea of building a general-purpose forward TCP proxy based on undertow. HTTP/2 is of interest here because of multiplexing, which would eliminate connection setup costs [of both TCP and TLS] between the client and proxy and substantially improve performance when many connections are needed.
If it matters, I used Jetty's HTTP/2 client library to connect to Undertow, although I had to patch it to not send path and scheme when method is CONNECT.