Removed a use of the deprecated Seed.getIP()

pull/93/head
luccioman 8 years ago
parent 669f60223e
commit 75802dcf00

@ -17,7 +17,7 @@
Simply use the following code: Simply use the following code:
</h3> </h3>
<fieldset><pre> <fieldset><pre>
&lt;form method="get" accept-charset="UTF-8" action="http://#[myaddress]#/yacysearch.html"&gt; &lt;form method="get" accept-charset="UTF-8" action="#[myaddress]#/yacysearch.html"&gt;
&lt;div style="text-align:center; padding:5px; background-color:#eeeeee; border:1px solid #cccccc; -webkit-border-radius:5px; -moz-border-radius:5px; border-radius:5px; display:block; float:left; margin-right:5px;"&gt; &lt;div style="text-align:center; padding:5px; background-color:#eeeeee; border:1px solid #cccccc; -webkit-border-radius:5px; -moz-border-radius:5px; border-radius:5px; display:block; float:left; margin-right:5px;"&gt;
&lt;div style="font-family:Arial,Helvetica,sans-serif; font-size:16px; display:block; float:left; padding-top:3px; padding-right:5px;"&gt; &lt;div style="font-family:Arial,Helvetica,sans-serif; font-size:16px; display:block; float:left; padding-top:3px; padding-right:5px;"&gt;
MySearch MySearch
@ -41,7 +41,7 @@
</pre></fieldset> </pre></fieldset>
This would look like: This would look like:
<form method="get" accept-charset="UTF-8" action="http://#[myaddress]#/yacysearch.html"> <form method="get" accept-charset="UTF-8" action="yacysearch.html">
<div style="text-align:center; padding:5px; background-color:#eeeeee; border:1px solid #cccccc; -webkit-border-radius:5px; -moz-border-radius:5px; border-radius:5px; display:block; float:left; margin-right:5px;"> <div style="text-align:center; padding:5px; background-color:#eeeeee; border:1px solid #cccccc; -webkit-border-radius:5px; -moz-border-radius:5px; border-radius:5px; display:block; float:left; margin-right:5px;">
<div style="font-family:Arial,Helvetica,sans-serif; font-size:16px; display:block; float:left; padding-top:3px; padding-right:5px;"> <div style="font-family:Arial,Helvetica,sans-serif; font-size:16px; display:block; float:left; padding-top:3px; padding-right:5px;">
MySearch MySearch

@ -24,19 +24,19 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
import net.yacy.cora.protocol.RequestHeader; import net.yacy.cora.protocol.RequestHeader;
import net.yacy.http.servlets.YaCyDefaultServlet;
import net.yacy.search.Switchboard; import net.yacy.search.Switchboard;
import net.yacy.server.serverObjects; import net.yacy.server.serverObjects;
import net.yacy.server.serverSwitch; import net.yacy.server.serverSwitch;
public class ConfigSearchBox { public class ConfigSearchBox {
public static serverObjects respond(@SuppressWarnings("unused") final RequestHeader header, @SuppressWarnings("unused") final serverObjects post, final serverSwitch env) { public static serverObjects respond(final RequestHeader header, @SuppressWarnings("unused") final serverObjects post, final serverSwitch env) {
final serverObjects prop = new serverObjects(); final serverObjects prop = new serverObjects();
final Switchboard sb = (Switchboard) env; final Switchboard sb = (Switchboard) env;
String myaddress = sb.peers.mySeed().getIP() == null ? null : sb.peers.mySeed().getPublicAddress(sb.peers.mySeed().getIP()); /* Fill the base URL used to render a sample code integration example */
if (myaddress == null) myaddress = "localhost:" + sb.getLocalPort(); prop.put("myaddress", YaCyDefaultServlet.getContext(header, sb));
prop.put("myaddress", myaddress);
return prop; return prop;
} }

Loading…
Cancel
Save