I wrote a Proxy in C# using sockets and a TCPListener listening to a particular port. Currently the listener gets the "GET" request from the clients browser, and then uses the Socket.Send() class to forward the request on behalf of of the client. The response is recieved using the Socket.Reveive() class and then forwarded onto the client using Socket.Send() once again.
This works lovely when the client requests a basic html website. However when the client requests a website that contains some javascript such as <body onload='doThis();'
, it fails to run the javascript.
In this specific scenario, the javasript function does a redirect. Do I need to change something in the socket settings to allow the javascript to run when it gets sent to the client?