I have made substantial progress on this, so I want to give others who may have a similar issue an idea of what they can do…
Using Lua, its possible to inspect the incoming packet using a tcp-content request <lua.myaction> directive in the Frontend. In my case, this action reads the incoming packet, extracts the address information as well as some state information and then adds a session variable to the session containing that information. Note that in order for this to work, there must be sufficient delay configured on incoming connections to allow the first packet to be read.
Then, use-backend references this variable to extract the desired hostname. The config file already has a list of all possible backends available (whether the servers are up or not), so use-backend will either directly switch to the requested backend and attempt to connect to the desired server (through DNS resolution or static IPs as appropriate to the configuration), or it will failover (ultimately in my case, rejecting the connection.)
The other part of my request was to start the server if the incoming packet is a request for a connection as opposed to a request for status. This information is also available in the packet, so part of the session variable is populated with this. Additionally, if it is a connection request, the Lua script launches a shell script to start the server, passing that script the desired public address (which results in a call to a REST service that launches the server if it is not already launched.)
One has to be careful here about making blocking calls - in particular it doesn’t appear possible to make a complete REST transaction from directly within Lua as when I get to the response reading part, the connection appears to be closed and no response body is available (thus I decided to use an external script instead.) Curiously, if one uses os.execute - which is a blocking call - that will work, but presumably this blocks some internal HAProxy networking threads for the duration, so probably not advisable.
Rather than one use-backend directive I actually have two, and each is conditional on an ACL which determines whether to use the backend which goes to the server, or use the backend which goes to a status service - the latter making the server look like its available even if it isn’t presently running so the server can appear to be online at all times.
So that’s where I am at now.