Is it possible to make a relay agent (application layer) of a server (service)? Any example? C will be better
I'm trying everything to NAT make a HTTP(or others) server be accessible from internet.
this is the previous question but with no luck.
http://stackoverflow.com/questions/11665793/http-server-behind-nats

So I'm trying to do the following

IE <--> agentC <---------NAT/Internet/.....----------->agentS<------->Apache Server

the scenario might be...

1.User input address in IE like "localhost:9999" (agentC)

2.agentC connect with agentS with Stun/TURN/ICE

3.agentS relay data to  Apache Server and then reply to client.


I also refer to the following:
http://stackoverflow.com/questions/6711086/is-it-possible-to-relay-a-socket

but the problem is:

1.the connection between agentC to agentS might be UDP, however the Http is on TCP, is it possible to "relay socket or packet"

2.I'm coding test code of agentS<---->Apache part, but 
if ((pp = popen("echo -e \"GET / HTTP/1.0\\n\\n\\n\"| nc localhost 80", "r")) == NULL) 
.........
But the out put always "400 Bad Request".
(while type "echo -e "GET / HTTP/1.0\n\n\n"| nc localhost 80" in console will be successful)

3.I will modify a simple console chatroom to be agentS and agentC, is it possible to carry the http data?

Thank you for your patience

Is it possible to make a relay agent (application layer) of a server (service)? Any example? C will be better
===

I'm trying everything to NAT make a HTTP(or others) server be accessible from internet.
this is the previous question but with no luck.
http://stackoverflow.com/questions/11665793/http-server-behind-nats

So I'm trying to do the following

IE <--> agentC <---------NAT/Internet/.....----------->agentS<------->Apache Server

the scenario might be...

1.User input address in IE like "localhost:9999" (agentC)

2.agentC connect with agentS with Stun/TURN/ICE

3.agentS relay data to  Apache Server and then reply to client.


I also refer to the following:
http://stackoverflow.com/questions/6711086/is-it-possible-to-relay-a-socket

but the problem is:

1.the connection between agentC to agentS might be UDP, however the Http is on TCP, is it possible to "relay socket or packet"

2.I'm coding test code of agentS<---->Apache part, but 
if ((pp = popen("echo -e \"GET / HTTP/1.0\\n\\n\\n\"| nc localhost 80", "r")) == NULL) 
.........
But the out put always "400 Bad Request".
(while type "echo -e "GET / HTTP/1.0\n\n\n"| nc localhost 80" in console will be successful)

3.I will modify a simple console chatroom to be agentS and agentC, is it possible to carry the http data?

Thank you for your patience
