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!
--
Justin Rogers
DigiTec Web Consultants, LLC.
Blog: http://weblogs.asp.net/justin_rogers
"Adam Clauss" <cab...@tamu.edu> wrote in message
news:7c52276a.04060...@posting.google.com...
Adam Clauss
cab...@tamu.edu
"Justin Rogers" <Jus...@games4dotnet.com> wrote in message
news:uCLIleB...@tk2msftngp13.phx.gbl...
--
Justin Rogers
DigiTec Web Consultants, LLC.
Blog: http://weblogs.asp.net/justin_rogers
"Adam Clauss" <cab...@tamu.edu> wrote in message
news:OfCXEvB...@TK2MSFTNGP10.phx.gbl...
If that does not fit your needs, then your kinda talking about writing a NAT
router. This can be done, but not sure how easier/hard it would be in .Net.
Would need direct IP access I think. An application router would be easier,
but not sure about your needs. I would look hard at fpipe, ISA, or other
before trying to code this. hth
--
William Stacey, MVP
"Adam Clauss" <cab...@tamu.edu> wrote in message
news:7c52276a.04060...@posting.google.com...
Thanks for the suggestions.
And no - I'm not set on doing it in .Net. I'm also proficient in C++, so
that would be the alternative if I needed a much "lower" level access
programming.
Adam Clauss
cab...@tamu.edu
"William Stacey [MVP]" <stacey...@mvps.org> wrote in message
news:OkfbfUCS...@tk2msftngp13.phx.gbl...
The exception is the fact that I need to run two applications on the 'same
port'. I do not believe that those applications will give me the ability to
filter incoming connections (that are on the SAME port) and, depending on
their content, redirect to different places.
They WILL give me a very good place to start from however.
Adam Clauss
cab...@tamu.edu
"Adam Clauss" <cab...@tamu.edu> wrote in message
news:OlGgZTD...@TK2MSFTNGP11.phx.gbl...
--
William Stacey, MVP
"Adam Clauss" <cab...@tamu.edu> wrote in message
news:uj2EscDS...@TK2MSFTNGP09.phx.gbl...