From mboxrd@z Thu Jan 1 00:00:00 1970 Delivered-To: chneukirchen@gmail.com Received: by 10.140.141.15 with SMTP id o15cs18275rvd; Sun, 7 Feb 2010 03:57:52 -0800 (PST) Received-SPF: pass (google.com: domain of 3vqpuSwgJCiMIESTBJDQFL9HK.BNLQ9BJ-CDUDKFNNFKDFQNTOR.BNL@groups.bounces.google.com designates 10.220.123.197 as permitted sender) client-ip=10.220.123.197; Authentication-Results: mr.google.com; spf=pass (google.com: domain of 3vqpuSwgJCiMIESTBJDQFL9HK.BNLQ9BJ-CDUDKFNNFKDFQNTOR.BNL@groups.bounces.google.com designates 10.220.123.197 as permitted sender) smtp.mail=3vqpuSwgJCiMIESTBJDQFL9HK.BNLQ9BJ-CDUDKFNNFKDFQNTOR.BNL@groups.bounces.google.com; dkim=pass header.i=3vqpuSwgJCiMIESTBJDQFL9HK.BNLQ9BJ-CDUDKFNNFKDFQNTOR.BNL@groups.bounces.google.com Received: from mr.google.com ([10.220.123.197]) by 10.220.123.197 with SMTP id q5mr433210vcr.3.1265543871551 (num_hops = 1); Sun, 07 Feb 2010 03:57:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=beta; h=domainkey-signature:received:x-beenthere:received:received:received :received:received-spf:received:received:received:mime-version :subject:from:in-reply-to:date:message-id:references:to:x-mailer :x-original-authentication-results:x-original-sender:reply-to :precedence:mailing-list:list-id:list-post:list-help:list-archive :x-thread-url:x-message-url:sender:list-subscribe:list-unsubscribe :content-type:content-transfer-encoding; bh=1EhivngfILoi/mckQlgMRaNaqNQoPeenPFhqugalXmo=; b=ebHaC8AmOIcGfDbxSq4lF6mVuw7Asdv2RnGtXWCHb/WROKQrvLDCuD7+NJ/A4sTwu0 kOY96/WgnTNdEzZxSzzgeTtvdxwyB4Li2B4HK5OXgb+1TtTGbgU9caSRa109No/5YTGe w06G4QtJkJcKoCm7CEmurV2GKURPCXo1B0f3A= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlegroups.com; s=beta; h=x-beenthere:received-spf:mime-version:subject:from:in-reply-to:date :message-id:references:to:x-mailer:x-original-authentication-results :x-original-sender:reply-to:precedence:mailing-list:list-id :list-post:list-help:list-archive:x-thread-url:x-message-url:sender :list-subscribe:list-unsubscribe:content-type :content-transfer-encoding; b=5l5fQzYoFscXokPrVmmBURVIyL9pTlUo/wQLJIVI+oR4G8mk1I+vodh/OWdVHXLCnC 21E+xyqHabrhn28/tmFiHDLdtvhVMYyFIzbUQSfuSEK+e8DNBH8y86zqAaCijm7nxV1G bQJG4XS2M6jShprPIrizLwI/l06bA9AsSaTo4= Received: by 10.220.123.197 with SMTP id q5mr39499vcr.3.1265543870296; Sun, 07 Feb 2010 03:57:50 -0800 (PST) X-BeenThere: rack-devel@googlegroups.com Received: by 10.220.174.133 with SMTP id t5ls726135vcz.2.p; Sun, 07 Feb 2010 03:57:48 -0800 (PST) Received: by 10.220.65.156 with SMTP id j28mr867899vci.27.1265543868698; Sun, 07 Feb 2010 03:57:48 -0800 (PST) Received: by 10.220.65.156 with SMTP id j28mr867898vci.27.1265543868677; Sun, 07 Feb 2010 03:57:48 -0800 (PST) Return-Path: Received: from mail-ww0-f54.google.com (mail-ww0-f54.google.com [74.125.82.54]) by gmr-mx.google.com with ESMTP id 29si2872082vws.3.2010.02.07.03.57.47; Sun, 07 Feb 2010 03:57:47 -0800 (PST) Received-SPF: pass (google.com: domain of jftucker@gmail.com designates 74.125.82.54 as permitted sender) client-ip=74.125.82.54; Received: by wwj40 with SMTP id 40so1297459wwj.13 for ; Sun, 07 Feb 2010 03:57:47 -0800 (PST) Received: by 10.216.90.143 with SMTP id e15mr1763829wef.66.1265543866885; Sun, 07 Feb 2010 03:57:46 -0800 (PST) Return-Path: Received: from ?192.168.1.106? (bb-87-81-237-21.ukonline.co.uk [87.81.237.21]) by mx.google.com with ESMTPS id j8sm8150750gvb.17.2010.02.07.03.57.44 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 07 Feb 2010 03:57:44 -0800 (PST) Mime-Version: 1.0 (Apple Message framework v1077) Subject: Re: Middleware to dispatch request to multiple applications based on request domain name From: James Tucker In-Reply-To: Date: Sun, 7 Feb 2010 11:57:44 +0000 Message-Id: <09F3BCD8-6945-4DCC-BA70-A7F1777DC09C@gmail.com> References: To: rack-devel@googlegroups.com X-Mailer: Apple Mail (2.1077) X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of jftucker@gmail.com designates 74.125.82.54 as permitted sender) smtp.mail=jftucker@gmail.com; dkim=pass (test mode) header.i=@gmail.com X-Original-Sender: jftucker@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: List-Post: , List-Help: , List-Archive: X-Thread-Url: http://groups.google.com/group/rack-devel/t/82553516626086d8 X-Message-Url: http://groups.google.com/group/rack-devel/msg/50d5e204da0f769d Sender: rack-devel@googlegroups.com List-Subscribe: , List-Unsubscribe: , Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable On 6 Feb 2010, at 16:58, misza222 wrote: > Hi, >=20 > Here is a problem I have. > There is an app which consists of multiple subapps. Requests needs to > be dispatched to the particular subapp based on the domain name. > I thought Rack::URLMap may be a solution but couldn't make it to work > so eventually I created my own rack middleware that allowed me to > achieve it. Here is how it looks like = http://github.com/misza222/dispatch_by_domain > But am I reinventing a wheel here? Is there any way to achieve the > same thing with existing rack middleware? map "http://mydomain.com/" do run App1.new end map "http://otherdomain.com/" do run App2.new end >=20 > Cheers, >=20 > Michal