Login Register






C++ Web Browser filter_list
Author
Message
RE: C++ Web Browser #7
(12-18-2014, 11:11 AM)dopamine Wrote: What the fuck is that? Thats not how a HTTP GET packet looks like.

Code:
GET /newreply.php HTTP/0.9\r\n Host: sinister.ly\r\n User-Agent: Penis

This is more like it.

The fields you specified are optional fields.

Here is a basic web browser written in C++ (utilizes the libsocket framework)

Given, a web browser does not have to have ANY HTML parsing. This one does not, but it is still a web browser in essence.

Code:
#include "libsocket.h" #include <stdio.h> #include <string.h> #include <time.h> int main(int argc, char * * argv) { clientSocket *conn = new clientSocket("74.125.196.101", 80); char c, buf[1024]; printf("%02x\n", conn->getStatus()); sprintf(buf, "GET / HTTP/1.0\r\n\r\n"); //sample packet header conn->Write(buf, strlen(buf)); sleep(3); //give a tad delay while (conn->Read(&c, 1) > 0) printf("%c", c); fflush(stdout); conn->Close(); return 0; }

Reply





Messages In This Thread
RE: C++ Web Browser - by phyrrus9 - 12-18-2014, 06:02 AM
RE: C++ Web Browser - by The Toilet Paper King - 12-18-2014, 10:44 AM
RE: C++ Web Browser - by dopamine - 12-18-2014, 11:11 AM
RE: C++ Web Browser - by The Toilet Paper King - 12-18-2014, 12:40 PM
RE: C++ Web Browser - by phyrrus9 - 12-18-2014, 12:54 PM
RE: C++ Web Browser - by The Toilet Paper King - 12-18-2014, 01:33 PM
RE: C++ Web Browser - by phyrrus9 - 12-18-2014, 01:38 PM