Is it possible to communicate with a server other than the one the current page is being served from? Say i have two rails apps, one at example1.com and the other at example2.com , can I use link-to_remote in my app at example1.com which calls an action on example2.com? I havn''t been able to get it to work so I''m assuming there''s a security restriction?
While this is technically possible, most browsers restrict AJAX calls to the same domain as the page that is calling them for security reasons. -----Original Message----- From: rails-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org [mailto:rails-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org] On Behalf Of Alan Bullock Sent: Thursday, 23 June 2005 4:50 PM To: Rails List Subject: [Rails] ajax calls to a different server? Is it possible to communicate with a server other than the one the current page is being served from? Say i have two rails apps, one at example1.com and the other at example2.com , can I use link-to_remote in my app at example1.com which calls an action on example2.com? I havn''t been able to get it to work so I''m assuming there''s a security restriction? _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
On 6/23/05, Wayne Robinson <wayner-WE50rThZ+ga6c6uEtOJ/EA@public.gmane.org> wrote:> While this is technically possible, most browsers restrict AJAX calls to > the same domain as the page that is calling them for security reasons.However, you could proxy the call through your own web server using Apache''s mod_proxy or something similar. -- Regards, John Wilger ----------- Alice came to a fork in the road. "Which road do I take?" she asked. "Where do you want to go?" responded the Cheshire cat. "I don''t know," Alice answered. "Then," said the cat, "it doesn''t matter." - Lewis Carrol, Alice in Wonderland
John Wilger wrote:> On 6/23/05, Wayne Robinson <wayner-WE50rThZ+ga6c6uEtOJ/EA@public.gmane.org> wrote: > >>While this is technically possible, most browsers restrict AJAX calls to >>the same domain as the page that is calling them for security reasons. > > > However, you could proxy the call through your own web server using > Apache''s mod_proxy or something similar. >http://www.livejournal.com/users/premshree/66129.html This article presents a nice way to make cross site xhrequests using mod_rewrite and the proxy capabilities of Apache -- Claudio Cicali http://www.flexer.it GPG Keyid: 1024D/555D25CE ''Nos patriae finis et dulcia linquimus arva''