#include
#include
#include
#include
#include
#include
#define HTTPPORT 80
char* head =
"GET /u2/76292/ HTTP/1.1\r\n"
"Accept: */*\r\n"
"Accept-Language: zh-cn\r\n"
"Accept-Encoding: gzip, deflate\r\n"
"User-Agent: Mozilla/4.0 (compatible;
MSIE 6.0; Windows NT 5.1; SV1; CIBA; TheWorld)\r\n"
"Host:blog.chinaunix.net\r\n"
"Connection: Keep-Alive\r\n\r\n";
int connect_URL(char *domain,int port)
{
int
sock;
struct hostent *
host;
struct sockaddr_in server;
host =
gethostbyname(domain);
if (host == NULL)
{
printf("gethostbyname error\n");
return
-2;
}
// printf("HostName: