From mboxrd@z Thu Jan 1 00:00:00 1970 Delivered-To: chneukirchen@gmail.com Received: by 10.140.141.15 with SMTP id o15cs355685rvd; Sat, 6 Feb 2010 18:57:22 -0800 (PST) Received-SPF: pass (google.com: domain of 3DyxuSwgJCvQieovWyyyciWeh.YkinWYg-Zarahckkchacnkqlo.Yki@groups.bounces.google.com designates 10.150.175.11 as permitted sender) client-ip=10.150.175.11; Authentication-Results: mr.google.com; spf=pass (google.com: domain of 3DyxuSwgJCvQieovWyyyciWeh.YkinWYg-Zarahckkchacnkqlo.Yki@groups.bounces.google.com designates 10.150.175.11 as permitted sender) smtp.mail=3DyxuSwgJCvQieovWyyyciWeh.YkinWYg-Zarahckkchacnkqlo.Yki@groups.bounces.google.com; dkim=pass header.i=3DyxuSwgJCvQieovWyyyciWeh.YkinWYg-Zarahckkchacnkqlo.Yki@groups.bounces.google.com Received: from mr.google.com ([10.150.175.11]) by 10.150.175.11 with SMTP id x11mr3172474ybe.43.1265511441093 (num_hops = 1); Sat, 06 Feb 2010 18:57:21 -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:received-spf:received:mime-version:received:date :x-ip:user-agent:x-http-useragent:message-id:subject:from:to :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; bh=o4gNX09c3jQd69T07+ljMr4u2yhU6PzGuoyV8ck+ZZg=; b=yRyolye8vBKzXuWWNxYQ1UKnGq33+wdJ/e9nBughAnWmI+1FlI8ag2YuEUstmBtwje dV+QzhOyDB5QMYGPNw08ftaPtMYxA4qx69mqiARjeQCYgbo8HnHIgrXqBn6XQOrNMfCy GoR9OqlkeWpoJg0X6gVlRbNLNrvq8x27UUaro= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlegroups.com; s=beta; h=x-beenthere:received-spf:mime-version:date:x-ip:user-agent :x-http-useragent:message-id:subject:from:to: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; b=qx1qYUBmtCF6iYrk9wu1d5ZeS28dOgD4lJo0P7ofH7pa3TYzA63SkU3xDWvZOZqsgp uNpAQskR1n61qMf3oJIGaM02KPL5uKwlEt2VRM10+AxD++ppQQtEc1mH0YTpP4txb3Kg yOUmA1eMAK79iy2DgP+AfSPARNhOgLrDC9z90= Received: by 10.150.175.11 with SMTP id x11mr183696ybe.43.1265511439857; Sat, 06 Feb 2010 18:57:19 -0800 (PST) X-BeenThere: rack-devel@googlegroups.com Received: by 10.150.4.27 with SMTP id 27ls244442ybd.2.p; Sat, 06 Feb 2010 18:57:19 -0800 (PST) Received: by 10.150.127.10 with SMTP id z10mr4635133ybc.11.1265511438919; Sat, 06 Feb 2010 18:57:18 -0800 (PST) Received: by 10.90.16.19 with SMTP id 19mr4782939agp.14.1265475521031; Sat, 06 Feb 2010 08:58:41 -0800 (PST) Received: by 10.90.16.19 with SMTP id 19mr4782938agp.14.1265475521005; Sat, 06 Feb 2010 08:58:41 -0800 (PST) Return-Path: Received: from mail-yx0-f163.google.com (mail-yx0-f163.google.com [209.85.210.163]) by gmr-mx.google.com with ESMTP id 18si290052gxk.7.2010.02.06.08.58.40; Sat, 06 Feb 2010 08:58:41 -0800 (PST) Received-SPF: pass (google.com: domain of misza222@gmail.com designates 209.85.210.163 as permitted sender) client-ip=209.85.210.163; Received: by mail-yx0-f163.google.com with SMTP id 35so14648726yxe.2 for ; Sat, 06 Feb 2010 08:58:40 -0800 (PST) MIME-Version: 1.0 Received: by 10.150.238.3 with SMTP id l3mr167104ybh.56.1265475520962; Sat, 06 Feb 2010 08:58:40 -0800 (PST) Date: Sat, 6 Feb 2010 08:58:40 -0800 (PST) X-IP: 82.71.41.52 User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux x86_64; en-GB; rv:1.9.0.17) Gecko/2010010604 Ubuntu/9.04 (jaunty) Firefox/3.0.17,gzip(gfe),gzip(gfe) Message-ID: Subject: Middleware to dispatch request to multiple applications based on request domain name From: misza222 To: Rack Development 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/ccc3754e6e3481ed Sender: rack-devel@googlegroups.com List-Subscribe: , List-Unsubscribe: , Content-Type: text/plain; charset=ISO-8859-1 Hi, 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? Cheers, Michal