Today I practiced making a simple web server. However, we started with a few conceptual asides of what the internet is like what is a protocol, TCP/IP, port, and HTTP.
A protocol is a set of rules two sides agree on to use when communicating. Both the client and server are programmed to understand use that particular set of rules. It’s similar to two people from different countries agreeing on a language to speak in.
Two essential protocols that allows the internet to work is TCP and IP. IP stands for internet protocol address which agrees that each device connected to a computer network has their own numerical label. TCP stands for Transmission Control Protocol. It allows any information we are sending and splits it into pieces and sends it one at a time through a socket, from computer to computer. That individual piece is called a packet. The act of sending it in small packets of data is TCP.
Once a computer receives a packet, how it knows what program to send it to is a port. When a program is setup on the operating system to receive packets from a particular port, is considered “listening” to that port.
HTTP is a set of rules (and a format) for data being transferred on the web. Stands for HyperText Transfer Protocol. It is the core of how we send information on the internet from HTML, JS, and image files. It’s a format to define data being transferred via TCP/IP. Along with HTTP another important aside is MIME type. It’s a standard for specifying the type of data being sent. Stands for multipurpose internet mail extensions.
Here is the simple example of creating a web server in the course.
Then we later changed the MIME type to read HTML and JSON files.<div class='sharedaddy sd-block sd-like jetpack-likes-widget-wrapper jetpack-likes-widget-unloaded' id='like-post-wrapper-155635758-463-5d07756daeb39' data-src='https://widgets.wp.com/likes/#blog_id=155635758&post_id=463&origin=trilamanila.com&obj_id=155635758-463-5d07756daeb39' data-name='like-post-frame-155635758-463-5d07756daeb39'><h3 class="sd-title">Like this:</h3><div class='likes-widget-placeholder post-likes-widget-placeholder' style='height: 55px;'><span class='button'><span>Like</span></span> <span class="loading">Loading...</span></div><span class='sd-text-color'></span><a class='sd-link-color'></a></div>