Add http start-line to tcp message

Hello, thanks in advance for the help. Trying to figure out if this something haproxy can do.
I’m sure it can, I just can’t figure out how.

  1. receive a TCP connection on front end
  2. read the first line
  3. create an HTTP request with a body containing that first line from above.
  4. forward this HTTP request to back end, which is an http server.
  5. receive the http response (from the backend)
  6. extract the body from the http response
  7. return the extracted body to the TCP connection

for example
incoming tcp request on frontend

hello, my name is Earl

converts to this HTTP request, and sends to backend

POST / HTTP/1.1
Host: localhost:8000
User-Agent: haproxy

hello, my name is Earl

response from http server

HTTP/1.1 200 Ok
Server: IIS
User-Agent: haproxy

hello Earl!

haproxy extracts the body and send it alone back over TCP connection

hello Earl!