Presentation is loading. Please wait.

Presentation is loading. Please wait.

LURP Details. LURP Lab Details  1.Given a GET … call a proxy CGI script in the same way you would for a normal CGI request  2.This UDP perl.

Similar presentations


Presentation on theme: "LURP Details. LURP Lab Details  1.Given a GET … call a proxy CGI script in the same way you would for a normal CGI request  2.This UDP perl."— Presentation transcript:

1 LURP Details

2 LURP Lab

3 Details  1.Given a GET http:// … call a proxy CGI script in the same way you would for a normal CGI request  2.This UDP perl script  If it is in the cache, return it.  If it is not in the cache, send a UDP request to the broadcast address port 5656  IP Address, random port, URL sent to broadcast address  Listen on that port for a response  If no response get it yourself from the source  Send the result back to the browser  3. UDP Listen process  Recv on port 5656  If it is in the cache, send it to the address and port in the request.  1.Given a GET http:// … call a proxy CGI script in the same way you would for a normal CGI request  2.This UDP perl script  If it is in the cache, return it.  If it is not in the cache, send a UDP request to the broadcast address port 5656  IP Address, random port, URL sent to broadcast address  Listen on that port for a response  If no response get it yourself from the source  Send the result back to the browser  3. UDP Listen process  Recv on port 5656  If it is in the cache, send it to the address and port in the request.

4 Proxy Cache  The file can contain a simple comma delimited list of (URL, Filename, timestamp).  Keep a fixed number of entries in the cache (20)  When the cache is full, replace the least recently used entry  The file can contain a simple comma delimited list of (URL, Filename, timestamp).  Keep a fixed number of entries in the cache (20)  When the cache is full, replace the least recently used entry

5 Protocol  Broadcast message  [IP Address]::[Port]::[URL]CRLF  192.168.2.211::2345::http://cnn.com/foo.ht ml  Response  [Normal Response including HTTP/1.0 200 OK]  Don ’ t generate this from your web server  Broadcast message  [IP Address]::[Port]::[URL]CRLF  192.168.2.211::2345::http://cnn.com/foo.ht ml  Response  [Normal Response including HTTP/1.0 200 OK]  Don ’ t generate this from your web server

6 Proxy Session Request  GET http://star.cs.byu.edu/test.html HTTP/1.1  Host: star.cs.byu.edu  User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.0.8) Gecko/20061025 Firefox/1.5.0.8  Accept: text/xml,application/xml,application/xhtml+xml,text/html; q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5  Accept-Language: en-us,en;q=0.5  Accept-Encoding: gzip,deflate  Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7  Keep-Alive: 300  Proxy-Connection: keep-alive  GET http://star.cs.byu.edu/test.html HTTP/1.1  Host: star.cs.byu.edu  User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.0.8) Gecko/20061025 Firefox/1.5.0.8  Accept: text/xml,application/xml,application/xhtml+xml,text/html; q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5  Accept-Language: en-us,en;q=0.5  Accept-Encoding: gzip,deflate  Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7  Keep-Alive: 300  Proxy-Connection: keep-alive

7 Proxy Response  HTTP/1.0 200 OK  Date: Mon, 27 Nov 2006 14:02:14 GMT  Server: Apache/2.0.52 (Fedora)  Last-Modified: Fri, 15 Sep 2006 19:41:41 GMT  ETag: "8839e-14-369ca740"  Accept-Ranges: bytes  Content-Length: 20  Content-Type: text/html; charset=ISO-8859-1  X-Cache: MISS from weau-proxy  Proxy-Connection: keep-alive   TEST   HTTP/1.0 200 OK  Date: Mon, 27 Nov 2006 14:02:14 GMT  Server: Apache/2.0.52 (Fedora)  Last-Modified: Fri, 15 Sep 2006 19:41:41 GMT  ETag: "8839e-14-369ca740"  Accept-Ranges: bytes  Content-Length: 20  Content-Type: text/html; charset=ISO-8859-1  X-Cache: MISS from weau-proxy  Proxy-Connection: keep-alive   TEST 

8 Normal Response  HTTP/1.1 200 OK  Date: Mon, 27 Nov 2006 14:17:07 GMT  Server: Apache/2.0.52 (Fedora)  Last-Modified: Mon, 27 Nov 2006 14:17:03 GMT  ETag: "8839e-14-300c55c0"  Accept-Ranges: bytes  Content-Length: 20  Connection: close  Content-Type: text/html; charset=ISO-8859-1   TEST   HTTP/1.1 200 OK  Date: Mon, 27 Nov 2006 14:17:07 GMT  Server: Apache/2.0.52 (Fedora)  Last-Modified: Mon, 27 Nov 2006 14:17:03 GMT  ETag: "8839e-14-300c55c0"  Accept-Ranges: bytes  Content-Length: 20  Connection: close  Content-Type: text/html; charset=ISO-8859-1   TEST 

9 Details  You will need to read the Content-Length from the first response you receive so you can know where it ends  You may get multiple responses to the same request  You should put in a different random port each time so you don’t get responses from the last request.  You will need to read the Content-Length from the first response you receive so you can know where it ends  You may get multiple responses to the same request  You should put in a different random port each time so you don’t get responses from the last request.

10 Compatibility  An existing proxy server will be listening on port 5656 and will respond to requests for http://star.cs.byu.edu/test.htmlhttp://star.cs.byu.edu/test.html  You can use this to test for compatibility  An existing proxy server will be listening on port 5656 and will respond to requests for http://star.cs.byu.edu/test.htmlhttp://star.cs.byu.edu/test.html  You can use this to test for compatibility


Download ppt "LURP Details. LURP Lab Details  1.Given a GET … call a proxy CGI script in the same way you would for a normal CGI request  2.This UDP perl."

Similar presentations


Ads by Google