A
Adam Clauss
I am trying to work-around a firewall which limits me to only being
able to accept inbound connections on port 80. Unfortunately, I need
to two different applications to be able to accept connections. I
know of no "standard" way to make this work (and, its quite possible
that I am on the totally wrong track here and there just isn't a way
to do this).
I am trying to determine if it would be possible to write a 'gateway'
program that would actually be listening on port 80 and accept any
incoming connections. Upon accepting the connection, it would then
await the first packet of incoming data from the client (in both
applications, the first communication is done by the client). Once
this packet has been received, I should be able to look at the packet
and identify which application it is supposed to be for.
Here's where I am thinking this idea might not work. Upon figuring
out which application the connection was intended for, is there anyway
to ... "redirect" the socket connection to the appropriate
application, which might be listening on say ports 3000 and 3001.
Unfortunately, I cannot modify the other applications, so this would
need to all be transparent to them - the connection would just need to
appear as a 'brand new' connection to be Accepted. Preferably also,
that initial packet would still be in the network buffer (maybe a way
to "peek" at it from the gateway program rather than an actual read?).
If this 'redirection' cannot be done, I am also considering having the
gateway actually maintain the connection and forward data back and
forth. AKA: When an incoming connection is received, the gateway app
(which would be running physically on the same machine as the other
applications) would then open its own connection to the appropriate
application. Upon receiving data from the client, it would re-send
that data to the server. Likewise, upon receiving data from the
server, it would re-send that data to the client. However, while
possibly the easier (and maybe the only doable one) of the two
solutions, this one seems like the lesser of the two. First, the
server would actually be aware that the gateway was there - it would
see a local IP address rather than the clients. Second, I worry about
performance. In possibly high-traffic times, could all this
forwarding be costly?
Ideas? Thoughts? Suggestions?
Thanks!
able to accept inbound connections on port 80. Unfortunately, I need
to two different applications to be able to accept connections. I
know of no "standard" way to make this work (and, its quite possible
that I am on the totally wrong track here and there just isn't a way
to do this).
I am trying to determine if it would be possible to write a 'gateway'
program that would actually be listening on port 80 and accept any
incoming connections. Upon accepting the connection, it would then
await the first packet of incoming data from the client (in both
applications, the first communication is done by the client). Once
this packet has been received, I should be able to look at the packet
and identify which application it is supposed to be for.
Here's where I am thinking this idea might not work. Upon figuring
out which application the connection was intended for, is there anyway
to ... "redirect" the socket connection to the appropriate
application, which might be listening on say ports 3000 and 3001.
Unfortunately, I cannot modify the other applications, so this would
need to all be transparent to them - the connection would just need to
appear as a 'brand new' connection to be Accepted. Preferably also,
that initial packet would still be in the network buffer (maybe a way
to "peek" at it from the gateway program rather than an actual read?).
If this 'redirection' cannot be done, I am also considering having the
gateway actually maintain the connection and forward data back and
forth. AKA: When an incoming connection is received, the gateway app
(which would be running physically on the same machine as the other
applications) would then open its own connection to the appropriate
application. Upon receiving data from the client, it would re-send
that data to the server. Likewise, upon receiving data from the
server, it would re-send that data to the client. However, while
possibly the easier (and maybe the only doable one) of the two
solutions, this one seems like the lesser of the two. First, the
server would actually be aware that the gateway was there - it would
see a local IP address rather than the clients. Second, I worry about
performance. In possibly high-traffic times, could all this
forwarding be costly?
Ideas? Thoughts? Suggestions?
Thanks!