Created
November 13, 2017 23:10
-
-
Save nonlogos/b2f79644c6c7c016cf050273fcf1c41b to your computer and use it in GitHub Desktop.
Web Protocols #general
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Clients | |
Clients are computer programs that connect to servers | |
initiate a connection | |
Any computer can be a client |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# hypertext transfer protocol | |
how web servers and web browsers communicate | |
# HTTP verbs | |
HTTP requests begin with a VERB. | |
here are somethings each VERB is used for: | |
* GET - fetch a document | |
* POST - submit a form / send data / or sometimes upload a file | |
* HEAD - fetch metadata about a document | |
* PUT - upload a file | |
* DELETE | |
* OPTIONS | |
# HTTP headers | |
Headers have a key followed by a colon followed by a value: | |
key: value | |
# Curl commands | |
curl -s <url> : get file from the url | |
curl -H : set http request header | |
curl -sI <url> : only get the http response header | |
curl -d : data | |
curl -X POST <url> -d ... : post data |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Aside from servers and clients, there is a thrid role in computer networks: peer. | |
In a peer to peer network, clients establish connections directly to other clients. | |
Nodes in the network are symmetric with no fixed central servers (both are clients and servers at the same time) | |
Examples of peer to peer protocols: | |
* bittorrent | |
* webrtc |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Each computer can have many services | |
A port is a number between 1 and 65535 that differentiates among the services on a system | |
# customary ports | |
* 21 - ftp (control port) | |
* 22 - ssh | |
* 25 - smtp | |
* 80 - http | |
* 443 - https | |
* 3306 - mysql | |
* 5432 - postgresql | |
* 5984 - couchdb | |
* 6667 - irc | |
# port and permissions | |
by default, systems can only listen to ports below 1024 as the root user |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sometimes when people say 'server' they mean a computer program that listens for incoming connections | |
Other times when people say 'server' they mean a computer that is configured to run server programs | |
Any computer that has a networking stack can be a server |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# SSH is a binary protocol so we can't just |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Example of network protocols | |
# HTTP: browse web pages | |
# HTTPS: browse web pages with encryption | |
# SMTP: sends and receives emails | |
# IMAP, POP3: loads emails from an inbox | |
# IRC: chat | |
# FTP: file transfer | |
# SSH: remote shell over an encrypted connection | |
# SSL: low-level secure data transfer (used by HTTPS) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment