Tbp

435 views
347 views

Published on

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
435
On SlideShare
0
From Embeds
0
Number of Embeds
5
Actions
Shares
0
Downloads
7
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Tbp

  1. 1. “Test by Proxy” Mike Lee
  2. 2. 3 Problems Rendering of “my customers content” is not controlled by me, so how do I test effectively ? How do I know our servers are coping? If all ISN’T OK.. how do we quickly find out WTF HAPPENED ?
  3. 3. A Suggestion Generate clientside logging to be used by test, monitoring & analysis scripts
  4. 4. A few Impediments JS security problem Multi-browser support Time (“we want it now”)
  5. 5. The Proposal ICAP proxy to intecept & enhance HTML Log to file through FF or Chrome R4 == RailsReads&RendersResults
  6. 6. ICAP ? ICAP, the Internet Content Adaption Protocol, is a protocol aimed at providing ”simple object-based content vectoring for HTTP services”. ICAP is, in essence, a lightweight protocol for executing a quot;remote procedure callquot; on HTTP messages. It allows ICAP clients to pass HTTP messages to ICAP servers for some sort of transformation or other processing (quot;adaptationquot;). The server executes its transformation service on messages and sends back responses to the client, usually with modified messages. Typically, the adapted messages are either HTTP requests or HTTP responses. http://www.icap-forum.org/ documents/specification/rfc3507.txt
  7. 7. Setup...
  8. 8. You will need... Operating Sys: Linux ICAP Client: http://www.squid-cache.org/Download/ ICAP Server: http://sourceforge.net/projects/greasyspoon/ Runtime: Java (SE Runtime Env.) Scripting: JRuby Browser: Firefox
  9. 9. Greasyspoon require 'hpricot' def process(httpresponse) document = Hpricot(httpresponse) pfhead1 = '<script language=quot;JavaScriptquot;> function peepingfrog() {alert(quot;Peeping !quot;);} </script>' (document/quot;/html/headquot;).append pfhead1 pfhead2 = '<script language=quot;JavaScriptquot;> function peep() {allloaded = 0; while(allloaded < 1) { var imagesloaded = 1; var images = document.images;for (var i = 0;i<images.length;i++) { if(images[i].complete == false) { imagesloaded = 0; } } allloaded = imagesloaded; }; window.location = quot;file://pf.txtquot;; } </script>' (document/quot;/html/headquot;).append pfhead2 (document/quot;/html/bodyquot;).set(:onload => 'quot;peep()quot;') pfbody = '<div><img src=quot;/home/mike/pf.jpgquot; alt=quot;Peep!quot;></div>' (document/quot;/html/bodyquot;).append pfbody return quot;#{document}quot; end $httpresponse = process($httpresponse)
  10. 10. End of part 1 Comments ? Questions ? Suggestions ? mike.lee@europe.com

×