I need to build a local fake http server. It will listen all my http request and will decide which packet will be dropped or forward or delayed. Can I do that ? If I can how can I do it ?
Can I do that ?
Yes
If I can how can I do it ?
First, make a socket server:
http://www.switchonthecode.com/tutorials/csharp-tutorial-simple-threaded-tcp-server
Next, parse HTTP and respond to it (linked in HTTP/1.0 for simplicity):
http://www.ietf.org/rfc/rfc1945.txt
As for "dropped or delayed", a "web server" does not operate at a packet level, you will have to clarify what you need it to do.
精彩评论