From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ivan Shmakov Newsgroups: gmane.emacs.bugs Subject: bug#17959: support accessing FTP services via HTTP proxies Date: Tue, 16 Dec 2014 20:09:24 +0000 Message-ID: <877fxricgb.fsf_-_@violet.siamics.net> References: <87mwcmb8nx.fsf@violet.siamics.net> <87r3wz7h0e.fsf@violet.siamics.net> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1418760622 28123 80.91.229.3 (16 Dec 2014 20:10:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 16 Dec 2014 20:10:22 +0000 (UTC) To: 17959@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Dec 16 21:10:17 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Y0yRl-0003yE-Dt for geb-bug-gnu-emacs@m.gmane.org; Tue, 16 Dec 2014 21:10:17 +0100 Original-Received: from localhost ([::1]:46677 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y0yRk-0002IF-Ju for geb-bug-gnu-emacs@m.gmane.org; Tue, 16 Dec 2014 15:10:16 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55629) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y0yRc-0002Ev-SA for bug-gnu-emacs@gnu.org; Tue, 16 Dec 2014 15:10:13 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y0yRY-00023c-IP for bug-gnu-emacs@gnu.org; Tue, 16 Dec 2014 15:10:08 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:38802) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y0yRW-0001xW-Pf for bug-gnu-emacs@gnu.org; Tue, 16 Dec 2014 15:10:04 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Y0yRW-0005Cg-9T for bug-gnu-emacs@gnu.org; Tue, 16 Dec 2014 15:10:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Ivan Shmakov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 16 Dec 2014 20:10:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 17959 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: wontfix Original-Received: via spool by 17959-submit@debbugs.gnu.org id=B17959.141876057819967 (code B ref 17959); Tue, 16 Dec 2014 20:10:02 +0000 Original-Received: (at 17959) by debbugs.gnu.org; 16 Dec 2014 20:09:38 +0000 Original-Received: from localhost ([127.0.0.1]:48168 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y0yR8-0005Bz-3H for submit@debbugs.gnu.org; Tue, 16 Dec 2014 15:09:38 -0500 Original-Received: from fely.am-1.org ([78.47.74.50]:44987) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y0yR4-0005Bo-U8 for 17959@debbugs.gnu.org; Tue, 16 Dec 2014 15:09:36 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=siamics.net; s=a2013295; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:Sender:References:Subject:To:From; bh=KdPfLTh0+J26Rkqq/oZKXTvKpR9o5XiluLZA6i8taio=; b=GWB3op/8gfBbs8GkRcMVAjpIDsijSzZuxJIciuhkVjUWknllp5fxf54PZ1C58kzXhjajS4YDrnmTL376LXHLLf3WDf08VemIdIYQXL7/MQaq6vKxuCz92hFNzMWtlPN7JliUqQaF4SCY6FEwSkal1/ow/FQj4NdsQuPskCrAesw=; Original-Received: from [2a02:2560:6d4:26ca::1:1d] (helo=violet.siamics.net) by fely.am-1.org with esmtps (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1Y0yR2-0007Ad-G4 for 17959@debbugs.gnu.org; Tue, 16 Dec 2014 20:09:33 +0000 Original-Received: from localhost ([::1] helo=violet.siamics.net) by violet.siamics.net with esmtps (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1Y0yQv-0008Lo-AE for 17959@debbugs.gnu.org; Wed, 17 Dec 2014 03:09:25 +0700 Mail-Followup-To: 17959@debbugs.gnu.org In-Reply-To: <87r3wz7h0e.fsf@violet.siamics.net> (Ivan Shmakov's message of "Wed, 19 Nov 2014 08:04:49 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:97406 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable >>>>> Ivan Shmakov writes: [=E2=80=A6] > Given that the only thing that EWW has to do to support ftp_proxy is > to ensure the user configuration specifies an HTTP proxy to use for > the target ftp: URI, it just seems like to simple a feature to omit > it. The patch MIMEd seems to resolve the issue. > When no HTTP proxy is specified for the URI, EWW should indeed > somehow invoke the Emacs native FTP client instead. > I guess the same approach may be applied to the other URI schemes > just as well (gopher:, perhaps?) FTR, =E2=80=93 I=E2=80=99ve tried to access [1] via Squid, and it just wor= ked. [1] gopher://gopher.docfile.org/1/world/monitoring/uptime [=E2=80=A6] --=20 FSF associate member #7257 http://boycottsystemd.org/ =E2=80=A6 3013 B6A0= 230E 334A --=-=-= Content-Type: text/diff Content-Disposition: inline --- a/lisp/net/eww.el 2014-12-09 03:21:57 +0000 +++ b/lisp/net/eww.el 2014-12-16 19:59:32 +0000 @@ -252,8 +238,15 @@ (setq url (string-trim url)) (cond ((string-match-p "\\`file:/" url)) ;; Don't mangle file: URLs at all. - ((string-match-p "\\`ftp://" url) - (user-error "FTP is not supported.")) + ((let* ((parsed (url-generic-parse-url url)) + (loader (url-scheme-get-property (url-type parsed) 'loader)) + (proxy (and (url-host parsed) + (url-find-proxy-for-url + parsed (url-host parsed))))) + (and (eq 'url-ftp loader) + (or (not proxy) + (not (string-match-p "^https?://" proxy))))) + (user-error "Direct FTP is not supported.")) (t (if (and (= (length (split-string url)) 1) (or (and (not (string-match-p "\\`[\"\'].*[\"\']\\'" url)) --=-=-=--