This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

HTTPS request forward as TCP  RSS feed

 
Terry Ong
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,

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?

Thanks for any pointers. Greatly appreciated.

With Regards,
Terry.
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It would be much easier to let a servlet container handle about all the security and networking issues instead of writing your own.

Since this is kind of a specialized thing to be doing, I doubt that Apache httpd can do anything like it out of the box. But you could certainly write an Apache module that can handle it.
 
Terry Ong
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ulf,

Thanks for your reply and tip on writing an Apache module.
Seems that writing the servlet is the easiest way.

Let's hope my performance doesn't gets affected too much,
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!