HTTPHack

Send your own HTTP Requests\Responses


How it works

 

HTTPhack 2.2 is quite different from other releases. This version is highly expermental!, but should still work as expected.

HTTPHack works in two modes - client and server. They each operate slightly different in terms of receiving data and processing it.

Client Mode reads all data received from the server before processing any of it. The recv() call is blocking, meaning it will wait until one of three things happen; server closes connection, TCP error returned, or select() timer expires (default is 5 seconds). Once recv() returns, we look for the HTTP delimiter (\r\n\r\n) and then process the entire message. Note there are only limited checks on the message length (if a mismatch between Content-Length and actual length for example).

Server Mode works by processing each line sent from the client, looking for the HTTP delimiter. This means that the server can return the response as soon as the clients made it, but this causes problems for requests which contain data, such as POST. Something due to be fixed very soon ;)

[ Back ]

© 2009 by John Payne.
http://www.the-serpent.co.uk