From mboxrd@z Thu Jan 1 00:00:00 1970 Delivered-To: chneukirchen@gmail.com Received: by 10.229.201.42 with SMTP id ey42csp117795qcb; Fri, 20 Apr 2012 12:58:22 -0700 (PDT) Return-Path: Received-SPF: pass (google.com: domain of rack-devel+bncCP_V2_zRBRDc_8b8BBoEud1_Fw@googlegroups.com designates 10.68.221.162 as permitted sender) client-ip=10.68.221.162; Authentication-Results: mr.google.com; spf=pass (google.com: domain of rack-devel+bncCP_V2_zRBRDc_8b8BBoEud1_Fw@googlegroups.com designates 10.68.221.162 as permitted sender) smtp.mail=rack-devel+bncCP_V2_zRBRDc_8b8BBoEud1_Fw@googlegroups.com; dkim=pass header.i=rack-devel+bncCP_V2_zRBRDc_8b8BBoEud1_Fw@googlegroups.com Received: from mr.google.com ([10.68.221.162]) by 10.68.221.162 with SMTP id qf2mr2159030pbc.12.1334951901040 (num_hops = 1); Fri, 20 Apr 2012 12:58:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=beta; h=x-beenthere:received-spf:from:mime-version:subject:date:in-reply-to :to:references:message-id:x-mailer: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=Wt+j8992dxkUTQr5ey1Gxu2cmcSAwlrjmOYnVvA0da8=; b=NcGvCMA4ZuGMDElSP+adJ/DAfrTrQT/Qska3dQnL7OGXZ6WFSmjO+gP9VVnKkDsCav gvtCmkj3eHqYzydv+FWSPTcGMONqGYduxs5attNtdJXz0lyN5hnoNSzeU6FpzNm3rndN NfXUK+78LocVUEoT8kPj7oO6zSFeS03wuCZEU= Received: by 10.68.221.162 with SMTP id qf2mr625499pbc.12.1334951900895; Fri, 20 Apr 2012 12:58:20 -0700 (PDT) X-BeenThere: rack-devel@googlegroups.com Received: by 10.68.115.43 with SMTP id jl11ls11237322pbb.4.gmail; Fri, 20 Apr 2012 12:58:20 -0700 (PDT) Received: by 10.68.202.168 with SMTP id kj8mr6664003pbc.1.1334951900057; Fri, 20 Apr 2012 12:58:20 -0700 (PDT) Received: by 10.68.202.168 with SMTP id kj8mr6664002pbc.1.1334951900041; Fri, 20 Apr 2012 12:58:20 -0700 (PDT) Received: from mail-pb0-f49.google.com (mail-pb0-f49.google.com [209.85.160.49]) by gmr-mx.google.com with ESMTPS id g5si8727020pbk.2.2012.04.20.12.58.20 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 20 Apr 2012 12:58:20 -0700 (PDT) Received-SPF: pass (google.com: domain of jftucker@gmail.com designates 209.85.160.49 as permitted sender) client-ip=209.85.160.49; Received: by mail-pb0-f49.google.com with SMTP id un4so1605985pbc.22 for ; Fri, 20 Apr 2012 12:58:20 -0700 (PDT) Received: by 10.68.196.231 with SMTP id ip7mr205683pbc.29.1334951899892; Fri, 20 Apr 2012 12:58:19 -0700 (PDT) Received: from [10.0.1.21] (c-67-180-21-214.hsd1.ca.comcast.net. [67.180.21.214]) by mx.google.com with ESMTPS id r10sm6197657pbf.22.2012.04.20.12.58.17 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 20 Apr 2012 12:58:18 -0700 (PDT) From: James Tucker Mime-Version: 1.0 (Apple Message framework v1257) Subject: Re: How to use a rack middleware in rails application? Date: Fri, 20 Apr 2012 12:58:16 -0700 In-Reply-To: <16441975.240.1334808670999.JavaMail.geo-discussion-forums@pbcuu8> To: rack-devel@googlegroups.com References: <19957665.775.1334754612976.JavaMail.geo-discussion-forums@pbcuc9> <3CB9A0D2-28B8-4E52-ACB3-9FA22656F724@gmail.com> <16441975.240.1334808670999.JavaMail.geo-discussion-forums@pbcuu8> Message-Id: <575D7BC2-77BB-400E-B61E-98DD9EF62F59@gmail.com> X-Mailer: Apple Mail (2.1257) X-Original-Sender: jftucker@gmail.com X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of jftucker@gmail.com designates 209.85.160.49 as permitted sender) smtp.mail=jftucker@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="Apple-Mail=_CD23081D-0C7F-45EA-892C-C54A6EE45373" --Apple-Mail=_CD23081D-0C7F-45EA-892C-C54A6EE45373 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii I suggest you proxy only the routes you need. On Apr 18, 2012, at 9:11 PM, shinn wrote: > Hi, thanks for your reply. >=20 > According to this source, CORS will required the targeted domain = (http://bar.other in this example) to response with the = "Access-Control-Allow-Origin". >=20 > 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. >=20 > On Thursday, April 19, 2012 6:09:45 AM UTC+8, raggi wrote: >=20 > On Apr 18, 2012, at 6:10 AM, shinn wrote: >=20 >> Hi all, >>=20 >> I'm currently developing a rails app that required to do cross side = scripting with ajax. I've been google around and found this rack = 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! >=20 > http://guides.rubyonrails.org/rails_on_rack.html >=20 > It sounds like you probably want CORS though, not a proxy. >=20 > http://blog.davelyon.net/cross-origin-resource-sharing-on-rails > http://www.tsheffler.com/blog/?p=3D428 > http://www.google.com/search?q=3DCORS+on+rails --Apple-Mail=_CD23081D-0C7F-45EA-892C-C54A6EE45373 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii I = suggest you proxy only the routes you need.

On Apr 18, = 2012, at 9:11 PM, shinn wrote:

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 this rack = 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://www.google.com/search?q=3DCORS+on+rails<= /div>

= --Apple-Mail=_CD23081D-0C7F-45EA-892C-C54A6EE45373--