Web Browser Application

For $3 — Ends 22 Jun 2018 (in about 21 hours)

For this program, you will be writing a web browser application. Your browser will display text only and will communicate with a standard web server.
Your text-only browser will not be able to display images, multimedia, special fonts, JavaScript, etc. It will support hyperlinks. We're concerned with the networking aspect, not the presentation aspect. I will provide you with simple web pages (with text and one image) that your program can retrieve that do not have this content in them. You will need to use TCP socket calls. The browser is a client program.
For the browser:
Hyperlinks embedded in the page should be indicated with a X) printed in front of the linked text. The X should be replaced with the link's relative order in the page (i.e., 1,2,3...).
For each page viewed, the user/client should be prompted to:
• Select one of the numbered links or
• Specify a new URL.
On startup, the user/client has only one choice, entering a URL (e.g. http://csweb01.csueastbay.edu/~td4679/Pgm3/start.html
Now you want to:
• Parse the URL to separate the protocol, machine name, and file location.
• Resolve the name (get the corresponding IP address – use gethostbyname()
• Set up a TCP connection with the web server at that address
• Send an HTTP request for the requested page
• Receive the HTML file and display the page. This includes parsing the HTML code (primarily, throwing most of it away), indicating the links, and printing a prompt for the user (like "Enter choice 1..3 or a new URL").
• The user will then type the number of one of the links or enter a new URL and the process repeats.
Note that the MIME header contains the length of the web page in bytes. When you've read this many bytes, you know you are done and can close the TCP connection.
When parsing the HTML, things don't need to look pretty. Basically, do not print anything which is between ''. These are HTML instructions, not text.
Exceptions to this rule are the links themselves, which begin:
For these, you should save the URL in an array or linked list and print out the hyperlink text start and print a number X) before the text indicating the relative link position in the page (e.g. 1) if this is the first link in the page). Again, the user can then select from these numbered links to choose the next page to load.
There are two methods for representing the URLs, an absolute URL or a relative URL.
An absolute URL looks like this: http://csweb01.sjsu.edu/~td4679/Pgm3/start.html and includes the protocol, hostname, and file location.
A relative URL might look like beach.html In this case, you are to assume that the protocol, host, and directory are the same as the presently shown page and only the file name changes. You can decide which you wish to use.
Also, when you see the tags or you should insert a blank line in the output.
The HTTP GET command needs to be followed by two control (CR) linefeed (LF) pairs in HTTP version 1.0. CR is ASCII value 13, linefeed is ASCII value 10.
The web server (csweb01) will be listening to port 80 (the standard port).
You will show that your browser works by displaying a few web pages, following some links in them, and capturing the output to a script file.
Here is a very simple web page written in HTML: - $750.0

Sign up to apply →

Posted on freelancer.com

Know a freelancer that can do this job?

Earn lifetime commission for every freelancer you refer, by becoming an affiliate. Find out more

Share this job: