• Advertisement
Sign in to follow this  

how write a client to access webserver?

This topic is 3635 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

which function can i use? I wanna a tool that multiple thread to access a page asap. where to start? thanks. popen ? libcurl?
#include <stdio.h>
#include "../curl-7.14.0/include/curl/curl.h"
#pragma comment(lib, "../curl-7.14.0/lib/libcurl_imp.lib")

int main(void)
{
  curl = curl_easy_init();
  if(curl) {

    CURLcode res;    
    res = curl_easy_setopt(curl, CURLOPT_PROXY, "Test-pxy08:8080");// what is it?
    res = curl_easy_setopt(curl, CURLOPT_PROXYTYPE, CURLPROXY_HTTP);//what is it?
    res = curl_easy_setopt(curl, CURLOPT_URL, "http://www.vckbase.com");
    res = curl_easy_perform(curl);

    if(CURLE_OK == res) {
      char *ct;
      /**//* ask for the content-type */
      /**//* http://curl.haxx.se/libcurl/c/curl_easy_getinfo.html */
      res = curl_easy_getinfo(curl, CURLINFO_CONTENT_TYPE, &ct);

      if((CURLE_OK == res) && ct)
        printf("We received Content-Type: %s ", ct);
    }

    /**//* always cleanup */
    curl_easy_cleanup(curl);
  }
  return 0;
}
socket?
send  "GET /index.htm HTTP/1.1\r\nHost: www.name.com\r\nConnection: Keep-Alive\r\n\r\n\r\n ", then recv 
any idea? thanks. if i wanna run js script which contain in page. how to do?

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement