From e11504309fb7f21a492598d17d6ccbc5c56faf33 Mon Sep 17 00:00:00 2001 From: reger Date: Sun, 30 Mar 2014 05:11:42 +0200 Subject: [PATCH] adding a hint to javascript browser short cut on Url-Proxy page (AugmentedBrowsing_p.html) --- htroot/AugmentedBrowsing_p.html | 6 ++++++ source/net/yacy/http/servlets/UrlProxyServlet.java | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/htroot/AugmentedBrowsing_p.html b/htroot/AugmentedBrowsing_p.html index e46d7f1eb..32efd617b 100644 --- a/htroot/AugmentedBrowsing_p.html +++ b/htroot/AugmentedBrowsing_p.html @@ -32,6 +32,12 @@

Enables or disables URL proxy for all search results. If enabled, all search results will be tunneled through URL proxy.

+

Alternatively you may add this javascript to your browser favorites/short-cuts, which will reload the current browser address + via the YaCy proxy servlet.
+ + javascript: window.location.href = ('http://localhost:8090/proxy.html?url=' + location.href); + or right-click this link and add to favorites: YaCy proxy start +

Restrict URL proxy use:
diff --git a/source/net/yacy/http/servlets/UrlProxyServlet.java b/source/net/yacy/http/servlets/UrlProxyServlet.java index bc509963d..586b5b004 100644 --- a/source/net/yacy/http/servlets/UrlProxyServlet.java +++ b/source/net/yacy/http/servlets/UrlProxyServlet.java @@ -71,7 +71,7 @@ import org.jsoup.select.Elements; * * Hint: a browser favorite of * javascript: window.location.href = ('http://localhost:9090/proxy.html?url=' + location.href); - * will start the urlproxy with the current broser address. + * will start the urlproxy with the current browser address. */ public class UrlProxyServlet extends ProxyServlet implements Servlet { @@ -267,7 +267,7 @@ public class UrlProxyServlet extends ProxyServlet implements Servlet { } response.setIntHeader(HeaderFramework.CONTENT_LENGTH, sbb.length); - FileUtils.copy (sbb,response.getOutputStream()); + response.getOutputStream().write(sbb); } else { if ((response.getHeader(HeaderFramework.CONTENT_LENGTH) == null) && prop.containsKey(HeaderFramework.CONNECTION_PROP_PROXY_RESPOND_SIZE)) {