Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I want to do this assignment using TCP Socket programming and python language an

ID: 3887001 • Letter: I

Question

I want to do this assignment using TCP Socket programming and python language and just show this with any HTML file with HTML content and the inline image

1. Goal

In this assignment, you will use sockets to write Firefaux, toy web browser program. All that your toy browser needs to do is to download a web page consisting of some HTML text and a single inline image object and store the base page and the inline image in two files in the local directory named respectively the same as the base HTML file and the image file on the remote machine.

Here is a sample web page: sample.html . For this page, your browser should store the base page and image file at ./sample.html and ./redsox.jpg respectively. Your browser will be tested over other web pages with the same characteristics but with different names and content.

2. Warmup tips and tricks

Play with HTTP by “speaking” the protocol using telnet as follows. On a shell, run
telnet people.cs.umass.edu 80
and then type
GET /~arun/590CC/PA1/sample.html
and you should see output like shown below. This output is the body of sample.html.

The telnet program above simply gives you a TCP connection underneath. So you can “speak” HTTP using a socket to establish a TCP connection and do the same. You can also download an image in a similar manner using HTTP GET request (although spitting out binary data on the console won’t be pretty).

You can also use wget, curl or other programs to download the file without yourself speaking HTTP.

Forget telnet, wget, curl, etc. at this point; that was just to familiarize you with the HTTP protocol. Your toy browser must download the specified files using sockets. Your toy browser can use either HTTP/1.0 or 1.1 commands.

3. Submission instructions

Please read the submission instructions carefully and follow them to a tee. A portion of the grade depends on whether your submission can be auto-graded.

File organization: You should submit your program with all of your source and binary files and a README file. The source files must be in a subdirectory of the top-level directory called src/, any binary files must be in a subdirectory of the top-level directory called lib/, and the README file must be in the top-level directory.

File names: Your main program should be called Firefaux__.ext where “” is replaced with your last name (without the “<” or “>” symbols or quotes in the filename); “” is replaced with the last four digits of your student ID; and “.ext” is replaced with the appropriate extension (e.g., .java for java source files, .class or .jar for java binary files, .py for python files, and so on).

Your top-level directory must be named Firefaux__ (with no extension).

Input: Your program should take a single command-line argument that is a URL. For example, if you are using java and your last name is Smith and the last four of your student ID is 3142, your main program should be called Firefaux_Smith_3142.java and should be runnable as follows from your top-level directory:
java -cp ./lib Firefaux_Smith_3142 https://people.cs.umass.edu/~arun/590CC/PA1/sample.html

Language: You can use any programming language of your choice! But there is a small catch. If your submission is in any language other than java, it obviously can not be run with the above command. So, you should supply a simple script called run_Firefaux in your top-level directory so that your submission can be run as follows:
./run_Firefaux https://people.cs.umass.edu/~arun/590CC/PA1/sample.html

If your program can not be auto-graded and you need us to manually inspect your submission, your README file in your submission’s top-level directory should clearly explain what you tried and what worked or didn’t work; how to compile your source files; and how to run your code. Your submission can not be graded, even for partial credit, if it is unclear how to run it.

Testing: This is probably the most important pre-submission activity. Make sure your program works correctly on test files such as those at https://people.cs.umass.edu/~arun/590CC/PA1/tests/test1.html (and others named test2.html, …, test5.html). We may test your programs on web pages other than just exactly these files, of course. But if your program works correctly on these files, there is a high likelihood that you have succeeded in the assignment’s goal to near perfection.

Final submission: Submit a package of your top-level directory as a single file called Firefaux__.zip or Firefaux__.tgz. For example, if your submission is Firefaux_Smith_3142.zip, the auto-grader will expect the following sequence of commands to work, so make sure it works at your end:
unzip Firefaux_Smith_3142.zip
cd Firefaux_Smith_3142/
java -cp ./lib Firefaux_Smith_3142 test_url1
diff expected_html_file actual_html_file
diff expected_img_file actual_img_file
java -cp ./lib Firefaux_Smith_3142 test_url2
// repeat diff checks
...

[~/590CC]> telnet people.cs.umass.edu 80 Trying 128.119.240.99.. . Connected to people.cs. umass.edu Escape character is '^] GET /~arun/590CC/PA1/sample.html Untitled Document Hello World! Random text. Some image. host.

Explanation / Answer

sudo apt-get install git screen python2.7 python-serial

mkdir -p ~/.opt && cd ~/.opt # just a user-owned directory for software. Replace with what suits your needs

git clone https://github.com/4refr0nt/luatool.git

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote