details in implement of transparent http redirection?
hi, all
I implemented a transparent http redirection(installed in GateWay) as following,
but it doesn't work [ in M$ windows :( ]
1. Get the http request from local, and then register the connection info (the web server ip requested for and the connection sequence) in a structure chained in memory which named as querytable_entry. So, each local PC will have its unique entry structure in which chains its all http connections info.
2. Change the destination ip to proxy and destination port to 8080 and fix ip and tcp checksum then forward the packet to the internet.
3. Get the response from the proxy:8080. Search the querytable for the right
entry and right connection registry [ if ((response.source_ip ==
connection.webserver_ip) && (response.sequence == nnection.sequence+1)) ]
4. Write back necessary info ( replace response.source_ip as
connection.webserver_ip and replace 8080 as 80), then fix the checksum.
The result :
1.I found that the tcp three shackhands is connected and the IE status bar print" web site found, please wait..."
2.Then local send a GET Request packet(of course redirected to proxy:8080) 3.Then local send some other packet to some.microsoft.com site 4.maybe timeout at proxy, proxy send .A...F. flag packet back, accordingly local send ...R.. flag packet to proxy. The process [local.get_request-->proxy; local<--proxy(.A...F.); local-->proxy(...R..) ] appear at least three times.
From the result, I guess:
1.The manipulated request is sent to proxy:8080 becourse of the tcp connection been built.
2.The connection works not properly after local send the Get Request packet. 3.I found the packet content(proxy is set in IE) have some difference from the normal packet content(proxy not set):
proxy set: GET http://www.google.com /HTTP /1.0
proxy not set: GET / HTTP / 1.1
proxy set: proxy-connection:Keep-Alive
porxy not set: Connection:Keep-Alive
and so on....
They are important in connection? Maybe these difference make my Get
Request packet not recognized by proxy, so I should add or change thoese message next step.
What should I do?
thanx!