#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>

int main(int argc,char** argv){
    int sock,ret;
    struct hostent *hostinfo;
    struct sockaddr_in name;
    FILE* fsock;
    char buf[1024];

    // lookup host (DNS); use
    // struct hostent *gethostbyname(const char *name);
    
    // fill in destination address.
    
    // create socket; use 
    // int socket(int domain, int type, int protocol);
    
    // connect to destination; use  
    // int connect(int sockfd, const struct sockaddr *serv_addr,
    //      socklen_t addrlen);
    
    // create a stream to read/write; use mode "r+"
    // FILE *fdopen(int fildes, const char *mode);
    
    // write to socket; use
    // int fprintf(FILE *stream, const char *format, ...);
    // you need to print "GET / HTTP/1.0\n\n"
    
    // read from socket; use 
    // char *fgets(char *s, int size, FILE *stream);
    // in loop, and then 
    // int fputs(const char *s, FILE *stream);
    // to output it to stdout.
    
    // closes socket; use 
    // int fclose(FILE *fp);

    return 0;
}
