Added socket test for HTTP rant

Most is taken from
http://www.php.net/manual/en/sockets.examples.php