Transparent support for Cross Domain Javascript web apps

  1 post   Feedicon  
Replies: 0 - Last Post: January 09, 2009 12:43
by: digitalrinaldo
showing 1 - 1 of 1
 
Posted: January 09, 2009 12:43 by digitalrinaldo
I tried to use the MultiProxyHandler to map remote websites into the local space of the page of the current web app. A specific application case is discussed http://digiorgio.com/blog/?p=197 The MultiProxyHandler did not work for me because it did not support https, Stephen modified it to support HTTPS and I added some support for in the handler. We have a working example that is allowing us to perform WebDAV from any AJAX based Javascript widget. The following config options for the MultiProxyHandler make it super simple to map remote domains into your domain. In the example below a remote Web Dav service is mapped into the current domain.

proxy.class=sunlabs.brazil.handler.MultiProxyHandler
proxy.prefix=/davtests
proxy.host=remote.webdav.com
proxy.protocol=https

Any POST or GET to /davtests gets sent to the remote web site remote.webdav.com. We should be checking the code in later today. If anyone is interested in developing some applications and or tests I can provide some assistance. Here is what the config options will look like. One reason we had to go to such an effort was the lack of support for arbitray methods like MKCOL in the current HTTPUrlConnection class. So we solved a few problems with this change.

  • A MultiProxyHandler that supports http and https
  • Support for arbitrary methods like MKCOL, PROPFIND....


# test the InstallHttpsHandler
# this adds HTTPS capability to the IncludeTemplate

port=4567
log=5
handler=main

main.class=sunlabs.brazil.server.ChainHandler
# main.handlers=template
main.handlers=template addssl trust

template.class=sunlabs.brazil.template.TemplateHandler
template.templates=set bsl include

set.class=sunlabs.brazil.template.SetTemplate
bsl.class=sunlabs.brazil.template.BSLTemplate
include.class=sunlabs.brazil.template.IncludeTemplate

#this installs the HttpsRequest "HTTPS" capability
addssl.class=sunlabs.brazil.sunlabs.InstallHttpsHandler

# This will cause sites with valid certs with the wrong host
# to still work. Invalid cert sites won't work though
trust.class=sunlabs.brazil.sunlabs.TrustMeHandler
Replies: 0 - Last Post: January 09, 2009 12:43
by: digitalrinaldo
  • Mysql
  • Glassfish
  • Jruby
  • Rails
  • Nblogo
Terms of Use; Privacy Policy;
© 2010, Oracle Corporation and/or its affiliates
(revision 20120127.ac94057)
 
 
Close
loading
Please Confirm
Close