Request a webpage
I'm studying the principles of a primitive browser.
I want to receive the source code of a webpage. I know little about this but i need to send some headers right?
I would like to do it by using some proxy i made up in my computer just to test.
Objective: Receive the source of a page "www.lol.com/page.html" for example, through localhost:8118 address
I cant find any good example of this, can you help me?
Google is your friend.
1) Read up on the basics. Wikipedia has a Sample HTTP Request among other things...
2) Wireshark - it's a program that lets you sniff network traffic. Go get it, and watch some HTTP requests go by. HTTP is simple enough to learn by example.
3) Read some RFCs for the details.
If you don't want to reimplement HTTP, and are more interested in the data and not the protocol, libcurl can save you from reinventing the wheel.
I learnt alot from this site:
You just type the address you want to visit, and it will show you the headers sent and received, including new line characters and payload data.