WebFund 2014W Lecture 6

From Soma-notes
Revision as of 21:00, 26 January 2014 by Soma (talk | contribs)

Video

Video from the lecture given on January 24, 2014 is available:


Notes

• Client-server

o	Key distinction: Which ports they communicate on
o	Web server means "I have a port listening on port 80"

• TCP/IP

o	Port number: Identifies programs, 16 bit

• DNS

o	Translating host-names to IP address
o	When typing in an address, browser needs to do a DNS lookup to translate it to an IP address

• HTTP

o	Modern browsers assume everything starts with "http://"

• HTML

• URL: Uniform Resource Locator

o	Components
   	  Name of the server you wish to contact
   	  Resource you're requesting

• Server: A "box" to serve and deal with requests • Internet: A network of other local networks, connecting them to each other • Packets: 1500 bytes, switched networks, how computers send information to each other over a network

o	Packet loss: When you're on a connection that loses too many packets, TCP cannot provide the illusion that you're on a continuous data stream

• IP address: source and destination both have one

o	Can ping computers to find out their IP addresses and find the IP address of a server serving a webpage
o	Identifies the computer to talk to

• When you're writing a web server, you're just writing a program that's running on a different port, and talking through TCP/IP • express: a framework

o	Difference between framework and middleware: Middleware is code that you can use; a framework is a way to organize your code, that may use middleware

• require: importing code from a directory to save time, instead of writing it yourself

o	Looks for the file that was input as a parameter

• var user refers to ./routers/user, but it's not used so it doesn't do anything • Web servers have infinite loops, in order to wait for events to come in so that they may handle it