bio photo

Email

Class Notes

$ host www.nyu.edu
WWW.NYU.EDU is an alias for WEB.NYU.EDU.
WEB.NYU.EDU has address 128.122.119.202 //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 www.google.com
www.google.com has address 4.35.21.187
www.google.com has address 4.35.21.163
www.google.com has address 4.35.21.162
www.google.com has address 4.35.21.153
www.google.com has address 4.35.21.172
www.google.com has address 4.35.21.177
www.google.com has address 4.35.21.183
www.google.com has address 4.35.21.168
www.google.com has address 4.35.21.158
www.google.com has address 4.35.21.173
www.google.com has address 4.35.21.148
www.google.com has address 4.35.21.182
www.google.com has address 4.35.21.178
www.google.com has address 4.35.21.152
www.google.com has address 4.35.21.167
www.google.com has address 4.35.21.157
www.google.com has IPv6 address 2607:f8b0:4006:809::1011

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

$ host oms255.itp.io
oms255.itp.io has address 104.131.109.131

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 *.itp.io

Watch the Public Key Cryptography Youtube video

CDN stands for content-delivery-network - as in tonjs.org (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){

data.id = socket.id

socket.broadcast.emit

})

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, foundUser.py); context.lineTo(foundUser.x, foundUser.y);

foundUser.px =

webRTC

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

camera.html

secureserver.js

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

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

			setInterval(function(){
				context.drawImage(video,0,0);
				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. 
			});