Transparent proxying - how to pass socket to local server without modification?

Posted by Luca Farber on Stack Overflow See other posts from Stack Overflow or by Luca Farber
Published on 2010-04-29T23:45:55Z Indexed on 2010/04/30 0:07 UTC
Read the original article Hit count: 402

Filed under:
|
|
|
|

Hello,

I have a program that listens on port 443 and then redirects to either an SSH or HTTPS local server depending on the detected protocol.

The program does this by connecting to the local server and proxying all data back and forth through its own process.

However, this causes the originating host on the local servers to be logged as localhost.

Is there any way to pass the socket directly to the local server process (rather than just making a new TCP connection) so that the parameters of sockaddr_in (or sockaddr_in6) will be retained?

Platform for this is Linux.

© Stack Overflow or respective owner

Related posts about linux

Related posts about socket