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 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 … 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.
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
Protocol Broadcast message [IP Address]::[Port]::[URL]CRLF ::2345:: ml Response [Normal Response including HTTP/ OK] Don ’ t generate this from your web server Broadcast message [IP Address]::[Port]::[URL]CRLF ::2345:: ml Response [Normal Response including HTTP/ OK] Don ’ t generate this from your web server
Proxy Session Request GET HTTP/1.1 Host: star.cs.byu.edu User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv: ) Gecko/ Firefox/ 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 ,utf-8;q=0.7,*;q=0.7 Keep-Alive: 300 Proxy-Connection: keep-alive GET HTTP/1.1 Host: star.cs.byu.edu User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv: ) Gecko/ Firefox/ 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 ,utf-8;q=0.7,*;q=0.7 Keep-Alive: 300 Proxy-Connection: keep-alive
Proxy Response HTTP/ OK Date: Mon, 27 Nov :02:14 GMT Server: Apache/ (Fedora) Last-Modified: Fri, 15 Sep :41:41 GMT ETag: "8839e ca740" Accept-Ranges: bytes Content-Length: 20 Content-Type: text/html; charset=ISO X-Cache: MISS from weau-proxy Proxy-Connection: keep-alive TEST HTTP/ OK Date: Mon, 27 Nov :02:14 GMT Server: Apache/ (Fedora) Last-Modified: Fri, 15 Sep :41:41 GMT ETag: "8839e ca740" Accept-Ranges: bytes Content-Length: 20 Content-Type: text/html; charset=ISO X-Cache: MISS from weau-proxy Proxy-Connection: keep-alive TEST
Normal Response HTTP/ OK Date: Mon, 27 Nov :17:07 GMT Server: Apache/ (Fedora) Last-Modified: Mon, 27 Nov :17:03 GMT ETag: "8839e c55c0" Accept-Ranges: bytes Content-Length: 20 Connection: close Content-Type: text/html; charset=ISO TEST HTTP/ OK Date: Mon, 27 Nov :17:07 GMT Server: Apache/ (Fedora) Last-Modified: Mon, 27 Nov :17:03 GMT ETag: "8839e c55c0" Accept-Ranges: bytes Content-Length: 20 Connection: close Content-Type: text/html; charset=ISO TEST
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.
Compatibility An existing proxy server will be listening on port 5656 and will respond to requests for You can use this to test for compatibility An existing proxy server will be listening on port 5656 and will respond to requests for You can use this to test for compatibility