2012-01-06

Grails Ajax Proxy Plugin

The Grails Ajax Proxy Plugin is now on GitHub.

Over 2 years ago I asked on the grails-user list if there was a Proxy Plugin available for Grails that was suitable for Ajax apps to work around the same origin policy.  I was told that nothing was available, so with a tip from Matt Raible's blog, I quickly wrote one using the proxy servlet from EdwardsTx.net.  It worked for my needs at the time, but nobody on the list had expressed much interest in it and I had a bad experience trying to publish an update to the Grails iUI Plugin, so I gave up.

Recently, I needed the plugin on another project, so I told my client that I'd put the source on GitHub in case they ever needed to modify it.  This week, I mentioned it on the grails-user list and on Twitter and Burt Beckwith submitted a pull request that cleans things up quite a bit.  He also changed the name to Grails Ajax Proxy Plugin.  (I renamed the GitHub repo accordingly and GitHub doesn't provide forwarding -- so if you get a 404 looking for it you're using the old URL.)

With Burt's help, we may even get it published into the Grails Plugins Portal.

(It's enough to make me consider updating the Grails iUI plugin after we release version 0.4...)

3 comments:

  1. Hi Sean,

    Great work with writing the plugin, it works great. However, in using your proxy plugin, I have come across a problem that I would appreciate your feedback on. Your plugin converts a post into a get, but in doing so, the JSON input that I provide has special characters converted to an encoding (eg. '{' = %7B) The JSON then becomes unreadable by the host that I am querying. Is there any method of me to proxy while conserving the post characteristics?

    Thanks,

    ReplyDelete
  2. Thanks. I'm glad you like it.

    Please report the problem over on the GitHub Issues tab:
    https://github.com/msgilligan/grails-ajax-proxy-plugin/issues
    It's possible it could be related to Issue #2.

    ReplyDelete
  3. Thanks,

    The difference between Issue #2 and this seem to be related, but not completely identical. I made another issue anyways. I'm looking into making a proxy through Apache or some other means outside of Grails to fix this issue as well.

    ReplyDelete