From mboxrd@z Thu Jan 1 00:00:00 1970 Delivered-To: chneukirchen@gmail.com Received: by 10.142.105.8 with SMTP id d8csp325536wfc; Wed, 18 Apr 2012 21:11:12 -0700 (PDT) Return-Path: Received-SPF: pass (google.com: domain of rack-devel+bncCN7nr533ExDfoL78BBoEMFK0xA@googlegroups.com designates 10.68.242.162 as permitted sender) client-ip=10.68.242.162; Authentication-Results: mr.google.com; spf=pass (google.com: domain of rack-devel+bncCN7nr533ExDfoL78BBoEMFK0xA@googlegroups.com designates 10.68.242.162 as permitted sender) smtp.mail=rack-devel+bncCN7nr533ExDfoL78BBoEMFK0xA@googlegroups.com; dkim=pass header.i=rack-devel+bncCN7nr533ExDfoL78BBoEMFK0xA@googlegroups.com Received: from mr.google.com ([10.68.242.162]) by 10.68.242.162 with SMTP id wr2mr352331pbc.10.1334808672102 (num_hops = 1); Wed, 18 Apr 2012 21:11:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=beta; h=x-beenthere:date:from:to:message-id:in-reply-to:references:subject :mime-version:x-original-sender:x-original-authentication-results :reply-to:precedence:mailing-list:list-id:x-google-group-id :list-post:list-help:list-archive:sender:list-subscribe :list-unsubscribe:content-type; bh=QmCYaUEbcgVnTEoLZd6IbqkuNsKF72MhtqszofYHQ8k=; b=d58w5LNqsn73RqhzYst4fZhDT9CswsUkt/FaYM1vaXWbS5GQmlkSFpVw9rDd3xpv75 H9wqbF9OF4bgDIflt9SAZp2POmJ31Ta/pTSUHdAoLYer8KdDGnckgUpEUjlKeco4bfTb koSMhNwpa/Zop74O5IV/VSFGnKS07FQWgfiJ4= Received: by 10.68.242.162 with SMTP id wr2mr67121pbc.10.1334808671990; Wed, 18 Apr 2012 21:11:11 -0700 (PDT) X-BeenThere: rack-devel@googlegroups.com Received: by 10.68.136.230 with SMTP id qd6ls4955787pbb.2.gmail; Wed, 18 Apr 2012 21:11:11 -0700 (PDT) Received: by 10.68.220.104 with SMTP id pv8mr66151pbc.16.1334808671411; Wed, 18 Apr 2012 21:11:11 -0700 (PDT) Date: Wed, 18 Apr 2012 21:11:10 -0700 (PDT) From: shinn To: rack-devel@googlegroups.com Message-ID: <16441975.240.1334808670999.JavaMail.geo-discussion-forums@pbcuu8> In-Reply-To: <3CB9A0D2-28B8-4E52-ACB3-9FA22656F724@gmail.com> References: <19957665.775.1334754612976.JavaMail.geo-discussion-forums@pbcuc9> <3CB9A0D2-28B8-4E52-ACB3-9FA22656F724@gmail.com> Subject: Re: How to use a rack middleware in rails application? MIME-Version: 1.0 X-Original-Sender: shinnyx@gmail.com X-Original-Authentication-Results: ls.google.com; spf=pass (google.com: domain of shinnyx@gmail.com designates internal as permitted sender) smtp.mail=shinnyx@gmail.com; dkim=pass header.i=@gmail.com Reply-To: rack-devel@googlegroups.com Precedence: list Mailing-list: list rack-devel@googlegroups.com; contact rack-devel+owners@googlegroups.com List-ID: X-Google-Group-Id: 486215384060 List-Post: , List-Help: , List-Archive: Sender: rack-devel@googlegroups.com List-Subscribe: , List-Unsubscribe: , Content-Type: multipart/alternative; boundary="----=_Part_239_5289589.1334808670998" ------=_Part_239_5289589.1334808670998 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Hi, thanks for your reply. According to this source, CORS will required the targeted domain (http://bar.other in this example) to response with the "Access-Control-Allow-Origin". This is the reason I'm not using CORS, because the targeted domain is not belong to me, I've no way to add the "Access-Control-Allow-Origin" header on its server. Correct me if I'm wrong. On Thursday, April 19, 2012 6:09:45 AM UTC+8, raggi wrote: > > > On Apr 18, 2012, at 6:10 AM, shinn wrote: > > Hi all, > > I'm currently developing a rails app that required to do cross side > scripting with ajax. I've been google around and found thisrack middleware that used rack on doing proxy. However I have no idea on > how to use it in my app. Please help, I'm using Rails 3.2.3. Thanks! > > > http://guides.rubyonrails.org/rails_on_rack.html > > It sounds like you probably want CORS though, not a proxy. > > http://blog.davelyon.net/cross-origin-resource-sharing-on-rails > http://www.tsheffler.com/blog/?p=428 > http://www.google.com/search?q=CORS+on+rails > ------=_Part_239_5289589.1334808670998 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi, thanks for your reply.

According to this source, CORS will required th= e targeted domain (http://bar.other in this example) to response with the "= Access-Control-Allow-Origin".

This is the reason I'm no= t using CORS, because the targeted domain is not belong to me, I've no way = to add the "Access-Control-Allow-Origin" header on its server. Correct me i= f I'm wrong.

On Thursday, April 19, 2012 6:09:45 AM UTC+8, raggi wro= te:

On Apr 18, 2012, at 6:10 AM, shinn wrote:

<= blockquote type=3D"cite">Hi all,

I'm currently developing a rails ap= p that required to do cross side scripting with ajax. I've been google arou= nd and found t= his rack middleware that used rack on doing proxy. However I have no id= ea on how to use it in my app. Please help, I'm using Rails 3.2.3. Thanks!<= br>


It sounds like you probably want= CORS though, not a proxy.

------=_Part_239_5289589.1334808670998--