I have a peculiar situation here that I must forward a HTTP request as a TCP connection.
Basically, I have a backend server that only accepts TCP connections that assumes a certain type of content/message. I would need to send a message from public internet to this server.
Due to sending over the public network, I would need to protect the message contents and it was decided that the message was sent as the payload of a HTTPS request.
The conclusion so far (from our limited knowledge) is that we have two options: 1. Write a custom webserver that accepts such connections and forwards the message to the backend server. 2. Use Tomcat or other servlet containers to help in the HTTPS authentication and stuff; with a web app that accepts the request and strips the headers and send the raw message through sockets to the backend synchronously (need to reply to request from backend).
To add, I would have to perform both client and server authentication.
I'm wondering has anyone has had similar experience? Is there also a way just to use HTTP servers (like Apache HTTP, IBM HTTP) to directly strip and forward the request to my backend server?