The Web: Serving

 

Lonce Wyse

Communication & New Media

lonce.wyse@cnm.nus.sg

Clients and Servers

1) Runs a server program

2) Runs your page/program

(in the browser)

0) Your web page

waiting to be served.

Server and browser can run on the same machine

Addressing

https://en.wikipedia.org/wiki/Main_Page

[128.199.159.233]

DNS map to

ip address: 

Addressing

LAN

(eg. NUS)

Address visible to others within same network

Address translation

Router

If you are running a server to serve your pages, others on the LAN can get your pages by using your (local) ip address!

http://192.168.2.120/Your_Page.html

Your local ip address

Your web page

What is your (local) ip address?

Mac computers:

  • Open terminal window, and type
  • ifconfig | grep "inet "

Windows computers:

  • Open cmd window, and type
  • ipconfig 
  • Look for "IPV4 address" 

Your address will something like: 

192.168.1.xxx or 172.23.x.xxx

So let's write this program (in nodejs) !

1) Runs a server program

2) Runs your page/program

(in the browser)

0) Your web page

waiting to be served.

Server and browser can run on the same machine

Made with Slides.com