Return-Path: X-Original-To: apmail-httpd-dev-archive@www.apache.org Delivered-To: apmail-httpd-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 707E217B3F for ; Thu, 9 Apr 2015 08:46:45 +0000 (UTC) Received: (qmail 49052 invoked by uid 500); 9 Apr 2015 08:46:45 -0000 Delivered-To: apmail-httpd-dev-archive@httpd.apache.org Received: (qmail 48984 invoked by uid 500); 9 Apr 2015 08:46:45 -0000 Mailing-List: contact dev-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list dev@httpd.apache.org Received: (qmail 48973 invoked by uid 99); 9 Apr 2015 08:46:45 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Apr 2015 08:46:44 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [94.185.90.68] (HELO slim.berklix.org) (94.185.90.68) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Apr 2015 08:46:39 +0000 Received: from mart.js.berklix.net (p5DCBEA64.dip0.t-ipconnect.de [93.203.234.100]) (authenticated bits=128) by slim.berklix.org (8.14.5/8.14.5) with ESMTP id t398pcZ4099765 for ; Thu, 9 Apr 2015 10:51:38 +0200 (CEST) (envelope-from jhs@berklix.com) Received: from fire.js.berklix.net (fire.js.berklix.net [192.168.91.41]) by mart.js.berklix.net (8.14.3/8.14.3) with ESMTP id t398kBOn051443 for ; Thu, 9 Apr 2015 10:46:11 +0200 (CEST) (envelope-from jhs@berklix.com) Received: from fire.js.berklix.net (localhost [127.0.0.1]) by fire.js.berklix.net (8.14.7/8.14.7) with ESMTP id t398jxOI029791 for ; Thu, 9 Apr 2015 10:46:11 +0200 (CEST) (envelope-from jhs@berklix.com) Message-Id: <201504090846.t398jxOI029791@fire.js.berklix.net> To: dev@httpd.apache.org Subject: how to get httpd to use a proxy, cascading to a 2nd proxy ? From: "Julian H. Stacey" Organization: http://berklix.com BSD Unix Linux Consultants, Munich Germany User-agent: EXMH on FreeBSD http://www.berklix.com/free/ X-URL: http://www.berklix.com/~jhs/cv/ Date: Thu, 09 Apr 2015 10:45:59 +0200 X-Virus-Checked: Checked by ClamAV on apache.org Hi dev@httpd.apache.org, I got no reply from users@ on 2nd April, with : Can httpd _use_ (not just _be_) a proxy, cascading to a 2nd proxy on a gate ? (Not just the common case of httpd serving as a proxy for down stream clients, though I need that too on same httpd, I already have that part working) I want to get httpd on an internal host to serve as a proxy to a USB tethered android (which it is already doing), + to pass requests over ethernet LAN to a 2nd proxy on a LAN gateway. This may seem unusual; the reason: An android is tethered (IP over USB) to a FreeBSD PC laptop, Orweb browser on Android allows use of a proxy, FreeBSD laptop runs apache 2.2.29 httpd (listening on the USB IP) with httpd proxy enabled & PC allows android to reach various httpd PCs on local LAN of the PC. I want to tell the httpd on the PC interfacing the android, to pass android requests to a 2nd httpd running as LAN proxy on the gateway host, to reach the internet. Why ? Why dont I just configure the FreeBSD PC to bridge packets from USB to LAN ethernet, & on to LAN gate ? - I've failed to create a bridge, Android rejects "route add default gw 192.168.42.139 dev rndis0" with: Not permitted, (I need to root the device), I think the FreeBSD PC side is OK: /etc/rc.conf gateway_enable="YES" + sysctl net.inet.ip.forwarding=1 - Laptop may later get a firewall (to protect LAN from android apps). If httpd can not use a remote proxy, maybe I'll try packet diversion via FreeBSD's ipfw, but I'm hoping dev@httpd have code that calls a proxy ? I've read http://httpd.apache.org/docs/2.2/urlmapping.html#proxy & contemplated nasty cludges eg: 1st httpd on PC connected to android: ServerName play.google.com Redirect temp /store/apps http://gate/playgoogle 2nd httpd on LAN gate: Redirect temp /playgoogle http://play.google.com/store/apps But it would be Ugly & wouldnt work for other URLs, eg when android map apps go other places to download maps etc. Maybe there's some clever mapping with http://httpd.apache.org/docs/2.2/rewrite/ 1st httpd to be receive request http://domain/url_under_domain & emit http://gate/indirect_trigger/domain/url_under_domain & 2nd=gate to redirect to http://domain/url_under_domain Ideas / suggestions / code / URLs please ? Cheers, Julian - -- Julian Stacey, BSD Linux Unix C Sys Eng Consultant Munich http://berklix.com Indent previous with "> ". Reply Below as a play script. Send plain text, Not quoted-printable, HTML, or base64.