Code Monkey home page Code Monkey logo

socket-programming's Introduction

Christy Yuen
Final Project 

Simply put my project is designed to read a website/host from the command line and also from the commend line, the port number. Then via TCP socket, the program will connect to the host and received the HTTP header as well as the HTML content of the website. After receiving the data through bytes it will convert the data and write it to 1 of 2 files. The first file is HTTPoutput.html, which will contain the data of the HTML body. The second file is 
Log.csv, which will contain all the attempts to connect to a host. Finally, the program will also catch exceptions such as HTTPS not supported, chunked transfer encoding not supported, and host could not be resolved. 

Below are the sources I used and what I used them for: 

https://www.geeksforgeeks.org/python-string-split/

https://thewebdev.info/2021/04/11/how-to-get-the-last-element-of-a-split-string-array/
^note

https://stackoverflow.com/questions/53715482/python-get-last-element-after-str-split
^last element

https://python-forum.io/thread-22603.html

https://stackoverflow.com/questions/509211/understanding-slicing

https://www.pythontutorial.net/python-basics/python-check-if-file-exists/

https://www.geeksforgeeks.org/python-os-path-exists-method/
^exisits function for file writing

https://stackoverflow.com/questions/11618118/python-check-if-a-hostname-is-resolved

https://stackoverflow.com/questions/3988193/using-python-sockets-to-receive-large-http-requests
^content length

https://stackoverflow.com/questions/69998845/socket-recv-receives-only-1-byte-of-datakko
^byte calculation

https://pythonprogramming.net/pickle-objects-sockets-tutorial-python-3/?completed=/buffering-streaming-data-sockets-tutorial-python-3/
^sending and receiving Python Objects with sockets

https://www.youtube.com/watch?v=3QiPPX-KeSc&t=855s

**Sources used had a range of forgetting basic python to data handling through byte reading to understanding the use of sockets. 

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.