bio photo


Class Notes

$ host
WWW.NYU.EDU is an alias for WEB.NYU.EDU.
WEB.NYU.EDU has address //this is ipv4
WEB.NYU.EDU has IPv6 address 2607:f600:8002:1::7 //this is ipv6
WEB.NYU.EDU mail is handled by 20 MX.NYU.EDU.
load balancing taking place

$ host has address has address has address has address has address has address has address has address has address has address has address has address has address has address has address has address has IPv6 address 2607:f8b0:4006:809::1011

A record is an alias for our netID pointint to IP address.

$ host has address

DNS lookup, takes time because it needs to be Cached around the internet.

Man in The Middle attack. Somebody has access to data stream while it’s in transit. Domain name, certificate from Cert authority (main ones: VeriSign, Thawte) that covers anything from *

Watch the Public Key Cryptography Youtube video

CDN stands for content-delivery-network - as in (network of servers that have copies or caches of servers), you typically go to the server closes to you.

Dissecting home-work

We need to figure who ‘othermouse’ is. Socket has a unique_ID from the client side.

socket.on(‘othermouse’, function(data){ =



On the client side:

socket.on(‘othermouse’, function(req,res,id){

}) var foundUser = null; for (var i = 0, i < users.length, i++){ if (users[i].id == id) {

foundUser = users[i]; } }

if(foundUser == null){

foundUser = {x: xval, y: yval, id: id, px:0, py:0} users.push(foundUser); }

context.moveTo(foundUser.px,; context.lineTo(foundUser.x, foundUser.y);

foundUser.px =


webRTC is an HTML5 standard that allows access to microphone and video. Also offers, peer-to-peer connectivity between users (without going through a server). It also has a DataChannel (that’s just raw data that can be sent back and forth). Summary: audio data, video data, server-less-p2p connections, data-channel (socket). video & audio would be compressed formats (likeh264 for video). webRTC doesn’t have universal browser support. Only works on Chrome+Firefox.

getUserMedia -> how to get access to camera+mic



Add, my-cert.pem and to the same directory on your VPS. 
if (navigator.getUserMedia) {
	navigator.getUserMedia({video: true}, function(stream) {
			video.src = window.URL.createObjectURL(stream) || stream;;

			var canvas = document.getElementById('thecanvas');
			var context = canvas.getContext('2d');

				console.log(canvasToDataURL); //contents of this canvas (which is projecting camera video) in string data format (it's called base64 encoded data). It's binary data. Base64 takes binary data and turns into text. Character sets 0-64 in ASCII, are converted back to binary - helps in transmitting data when other side (RX) is expecting binary data to come through. Sharing webcams is essentially sending dataURLs to the other guy.