Opened 9 years ago

Closed 4 years ago

#1842 closed enhancement (wontfix)

Allow custom handling of DNS failures

Reported by: zkw Owned by:
Priority: Medium Milestone:
Component: Polipo Version: Polipo: 1.0
Severity: Normal Keywords:
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

I like to be able to type search keywords straight into the location bar. Without a proxy, Firefox's "keyword.URL" feature[1] lets me do this. If there's just a single word and it's potentially a hostname, Firefox will first try to treat it as one, almost always getting a DNS failure before submitting it using keyword.URL. When there's a proxy configured it doesn't make sense for Firefox to attempt to detect DNS "host not found" errors -- it might have no access -- so it just hands a request for http://foobar/ to the proxy and returns what the proxy does.

Unlike Privoxy, Polipo doesn't provide a way to customise handling of DNS errors[2,3]. Such a feature has been discussed for Polipo[4] but never implemented as far as I can tell. I'm attaching a patch with an extremely simple workaround that does what I want, in a very similar way to Privoxy's: include some JavaScript in the response page so that the user can do whatever they like with the error, including redirection to FWSE[5] if they so choose. As Polipo has no templating system and hard-coding a keyword URL is unpalatable, the JavaScript is transcluded from Polipo's own webserver. I've also attached the JavaScript I use in case it's useful to someone.

I'd like you to consider including this patch.

Thanks,

zkw

[1] http://kb.mozillazine.org/Keyword.URL

[2] http://www.privoxy.org/user-manual/templates.html

[3] http://www.macosxhints.com/article.php?story=2005070411304373

[4] http://www.mail-archive.com/polipo-users@lists.sourceforge.net/msg00469.html

[5] http://en.wikipedia.org/wiki/FWSE

Child Tickets

Attachments (2)

handle-errors-with-javascript.patch (837 bytes) - added by zkw 9 years ago.
Patch to enable custom error handler
result.js (179 bytes) - added by zkw 9 years ago.
A handler that redirects host-not-found to <FWSE for hostname as keyword>

Download all attachments as: .zip

Change History (4)

Changed 9 years ago by zkw

Patch to enable custom error handler

Changed 9 years ago by zkw

Attachment: result.js added

A handler that redirects host-not-found to <FWSE for hostname as keyword>

comment:1 Changed 8 years ago by phobos

Resolution: wontfix

Polipo bugs should be opened at http://sourceforge.net/projects/polipo/

comment:2 Changed 4 years ago by arma

Severity: Normal
Status: newclosed
Note: See TracTickets for help on using tickets.