forked from I2P_Developers/i2p.i2p
- Move connection profile and delay connect to advanced config section
- Add persistent client key support to SOCKS IRC
This commit is contained in:
@ -886,7 +886,7 @@ public class I2PTunnel implements Logging, EventDispatcher {
|
||||
|
||||
ownDest = !isShared;
|
||||
I2PTunnelTask task;
|
||||
task = new I2PSOCKSTunnel(_port, l, ownDest, (EventDispatcher) this, this);
|
||||
task = new I2PSOCKSTunnel(_port, l, ownDest, (EventDispatcher) this, this, null);
|
||||
addtask(task);
|
||||
notifyEvent("sockstunnelTaskId", Integer.valueOf(task.getId()));
|
||||
} else {
|
||||
@ -899,10 +899,11 @@ public class I2PTunnel implements Logging, EventDispatcher {
|
||||
|
||||
/**
|
||||
* Run an SOCKS IRC tunnel on the given port number
|
||||
* @param args {portNumber [, sharedClient]} or (portNumber, ignored (false), privKeyFile)
|
||||
* @since 0.7.12
|
||||
*/
|
||||
public void runSOCKSIRCTunnel(String args[], Logging l) {
|
||||
if (args.length >= 1 && args.length <= 2) {
|
||||
if (args.length >= 1 && args.length <= 3) {
|
||||
int _port = -1;
|
||||
try {
|
||||
_port = Integer.parseInt(args[0]);
|
||||
@ -914,17 +915,20 @@ public class I2PTunnel implements Logging, EventDispatcher {
|
||||
}
|
||||
|
||||
boolean isShared = false;
|
||||
if (args.length > 1)
|
||||
if (args.length == 2)
|
||||
isShared = "true".equalsIgnoreCase(args[1].trim());
|
||||
|
||||
ownDest = !isShared;
|
||||
String privateKeyFile = null;
|
||||
if (args.length == 3)
|
||||
privateKeyFile = args[2];
|
||||
I2PTunnelTask task;
|
||||
task = new I2PSOCKSIRCTunnel(_port, l, ownDest, (EventDispatcher) this, this);
|
||||
task = new I2PSOCKSIRCTunnel(_port, l, ownDest, (EventDispatcher) this, this, privateKeyFile);
|
||||
addtask(task);
|
||||
notifyEvent("sockstunnelTaskId", Integer.valueOf(task.getId()));
|
||||
} else {
|
||||
l.log("sockstunnel <port>");
|
||||
l.log(" creates a tunnel that distributes SOCKS requests.");
|
||||
l.log("socksirctunnel <port> [<sharedClient> [<privKeyFile>]]");
|
||||
l.log(" creates a tunnel for SOCKS IRC.");
|
||||
notifyEvent("sockstunnelTaskId", Integer.valueOf(-1));
|
||||
}
|
||||
}
|
||||
|
@ -218,7 +218,12 @@ public class TunnelController implements Logging {
|
||||
setListenOn();
|
||||
String listenPort = getListenPort();
|
||||
String sharedClient = getSharedClient();
|
||||
_tunnel.runSOCKSIRCTunnel(new String[] { listenPort, sharedClient }, this);
|
||||
if (getPersistentClientKey()) {
|
||||
String privKeyFile = getPrivKeyFile();
|
||||
_tunnel.runSOCKSIRCTunnel(new String[] { listenPort, "false", privKeyFile }, this);
|
||||
} else {
|
||||
_tunnel.runSOCKSIRCTunnel(new String[] { listenPort, sharedClient }, this);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
@ -427,7 +432,9 @@ public class TunnelController implements Logging {
|
||||
public String getListenPort() { return _config.getProperty("listenPort"); }
|
||||
public String getTargetDestination() { return _config.getProperty("targetDestination"); }
|
||||
public String getProxyList() { return _config.getProperty("proxyList"); }
|
||||
/** default true */
|
||||
public String getSharedClient() { return _config.getProperty("sharedClient", "true"); }
|
||||
/** default true */
|
||||
public boolean getStartOnLoad() { return "true".equalsIgnoreCase(_config.getProperty("startOnLoad", "true")); }
|
||||
public boolean getPersistentClientKey() { return Boolean.valueOf(_config.getProperty("option.persistentClientKey")).booleanValue(); }
|
||||
public String getMyDestination() {
|
||||
|
@ -33,8 +33,9 @@ public class I2PSOCKSIRCTunnel extends I2PSOCKSTunnel {
|
||||
private static final Log _log = I2PAppContext.getGlobalContext().logManager().getLog(I2PSOCKSIRCTunnel.class);
|
||||
private static int __clientId = 0;
|
||||
|
||||
public I2PSOCKSIRCTunnel(int localPort, Logging l, boolean ownDest, EventDispatcher notifyThis, I2PTunnel tunnel) {
|
||||
super(localPort, l, ownDest, notifyThis, tunnel);
|
||||
/** @param pkf private key file name or null for transient key */
|
||||
public I2PSOCKSIRCTunnel(int localPort, Logging l, boolean ownDest, EventDispatcher notifyThis, I2PTunnel tunnel, String pkf) {
|
||||
super(localPort, l, ownDest, notifyThis, tunnel, pkf);
|
||||
setName(getLocalPort() + " -> SOCKSIRCTunnel");
|
||||
}
|
||||
|
||||
@ -45,7 +46,7 @@ public class I2PSOCKSIRCTunnel extends I2PSOCKSTunnel {
|
||||
@Override
|
||||
protected void clientConnectionRun(Socket s) {
|
||||
try {
|
||||
_log.error("SOCKS IRC Tunnel Start");
|
||||
//_log.error("SOCKS IRC Tunnel Start");
|
||||
SOCKSServer serv = SOCKSServerFactory.createSOCKSServer(s);
|
||||
Socket clientSock = serv.getClientSocket();
|
||||
I2PSocket destSock = serv.getDestinationI2PSocket(this);
|
||||
|
@ -33,8 +33,9 @@ public class I2PSOCKSTunnel extends I2PTunnelClientBase {
|
||||
// I2PSOCKSTunnel(localPort, l, ownDest, (EventDispatcher)null);
|
||||
//}
|
||||
|
||||
public I2PSOCKSTunnel(int localPort, Logging l, boolean ownDest, EventDispatcher notifyThis, I2PTunnel tunnel) {
|
||||
super(localPort, ownDest, l, notifyThis, "SOCKSHandler", tunnel);
|
||||
/** @param pkf private key file name or null for transient key */
|
||||
public I2PSOCKSTunnel(int localPort, Logging l, boolean ownDest, EventDispatcher notifyThis, I2PTunnel tunnel, String pkf) {
|
||||
super(localPort, ownDest, l, notifyThis, "SOCKSHandler", tunnel, pkf);
|
||||
|
||||
if (waitEventValue("openBaseClientResult").equals("error")) {
|
||||
notifyEvent("openSOCKSTunnelResult", "error");
|
||||
|
@ -163,23 +163,6 @@
|
||||
</div>
|
||||
<% } %>
|
||||
<% if (!"streamrclient".equals(tunnelType)) { %>
|
||||
<div id="profileField" class="rowItem">
|
||||
<label for="profile" accesskey="f">
|
||||
<%=intl._("Profile")%>(<span class="accessKey">f</span>):
|
||||
</label>
|
||||
<select id="profile" name="profile" title="Connection Profile" class="selectbox">
|
||||
<% boolean interactiveProfile = editBean.isInteractive(curTunnel);
|
||||
%><option <%=(interactiveProfile == true ? "selected=\"selected\" " : "")%>value="interactive"><%=intl._("interactive connection")%> </option>
|
||||
<option <%=(interactiveProfile == false ? "selected=\"selected\" " : "")%>value="bulk"><%=intl._("bulk connection (downloads/websites/BT)")%> </option>
|
||||
</select>
|
||||
</div>
|
||||
<div id="delayConnectField" class="rowItem">
|
||||
<label for="connectDelay" accesskey="y">
|
||||
<%=intl._("Delay Connect")%>(<span class="accessKey">y</span>):
|
||||
</label>
|
||||
<input value="1000" type="checkbox" id="connectDelay" name="connectDelay" title="Delay Connection"<%=(editBean.shouldDelay(curTunnel) ? " checked=\"checked\"" : "")%> class="tickbox" />
|
||||
<span class="comment">(<%=intl._("for request/response connections")%>)</span>
|
||||
</div>
|
||||
<div id="sharedtField" class="rowItem">
|
||||
<label for="shared" accesskey="h">
|
||||
<%=intl._("Shared Client")%>(<span class="accessKey">h</span>):
|
||||
@ -277,7 +260,31 @@
|
||||
<div class="subdivider">
|
||||
<hr />
|
||||
</div>
|
||||
|
||||
|
||||
<% if (!"streamrclient".equals(tunnelType)) { %>
|
||||
<div id="profileField" class="rowItem">
|
||||
<label for="profile" accesskey="f">
|
||||
<%=intl._("Profile")%>(<span class="accessKey">f</span>):
|
||||
</label>
|
||||
<select id="profile" name="profile" title="Connection Profile" class="selectbox">
|
||||
<% boolean interactiveProfile = editBean.isInteractive(curTunnel);
|
||||
%><option <%=(interactiveProfile == true ? "selected=\"selected\" " : "")%>value="interactive"><%=intl._("interactive connection")%> </option>
|
||||
<option <%=(interactiveProfile == false ? "selected=\"selected\" " : "")%>value="bulk"><%=intl._("bulk connection (downloads/websites/BT)")%> </option>
|
||||
</select>
|
||||
</div>
|
||||
<div id="delayConnectField" class="rowItem">
|
||||
<label for="connectDelay" accesskey="y">
|
||||
<%=intl._("Delay Connect")%>(<span class="accessKey">y</span>):
|
||||
</label>
|
||||
<input value="1000" type="checkbox" id="connectDelay" name="connectDelay" title="Delay Connection"<%=(editBean.shouldDelay(curTunnel) ? " checked=\"checked\"" : "")%> class="tickbox" />
|
||||
<span class="comment">(<%=intl._("for request/response connections")%>)</span>
|
||||
</div>
|
||||
|
||||
<div class="subdivider">
|
||||
<hr />
|
||||
</div>
|
||||
<% } // !streamrclient %>
|
||||
|
||||
<div id="optionsField" class="rowItem">
|
||||
<label><%=intl._("I2CP Options")%>:</label>
|
||||
</div>
|
||||
@ -379,7 +386,7 @@
|
||||
<hr />
|
||||
</div>
|
||||
|
||||
<% if ("client".equals(tunnelType) || "ircclient".equals(tunnelType)) { %>
|
||||
<% if ("client".equals(tunnelType) || "ircclient".equals(tunnelType) || "socksirctunnel".equals(tunnelType)) { %>
|
||||
<div id="optionsField" class="rowItem">
|
||||
<label for="privKeyFile" accesskey="k">
|
||||
<%=intl._("Persistent private key")%>(<span class="accessKey">k</span>):
|
||||
|
@ -187,18 +187,6 @@
|
||||
<input type="text" size="30" id="privKeyFile" name="privKeyFile" title="Path to Private Key File" value="<%=editBean.getPrivateKeyFile(curTunnel)%>" class="freetext" />
|
||||
</div>
|
||||
|
||||
<% if (!"streamrserver".equals(tunnelType)) { %>
|
||||
<div id="profileField" class="rowItem">
|
||||
<label for="profile" accesskey="f">
|
||||
<%=intl._("Profile")%>(<span class="accessKey">f</span>):
|
||||
</label>
|
||||
<select id="profile" name="profile" title="Connection Profile" class="selectbox">
|
||||
<% boolean interactiveProfile = editBean.isInteractive(curTunnel);
|
||||
%><option <%=(interactiveProfile == true ? "selected=\"selected\" " : "")%>value="interactive"><%=intl._("interactive connection")%> </option>
|
||||
<option <%=(interactiveProfile == false ? "selected=\"selected\" " : "")%>value="bulk"><%=intl._("bulk connection (downloads/websites/BT)")%> </option>
|
||||
</select>
|
||||
</div>
|
||||
<% } // !streamrserver %>
|
||||
<div id="destinationField" class="rowItem">
|
||||
<label for="localDestination" accesskey="L">
|
||||
<%=intl._("Local destination")%>(<span class="accessKey">L</span>):
|
||||
@ -290,6 +278,23 @@
|
||||
<hr />
|
||||
</div>
|
||||
|
||||
<% if (!"streamrserver".equals(tunnelType)) { %>
|
||||
<div id="profileField" class="rowItem">
|
||||
<label for="profile" accesskey="f">
|
||||
<%=intl._("Profile")%>(<span class="accessKey">f</span>):
|
||||
</label>
|
||||
<select id="profile" name="profile" title="Connection Profile" class="selectbox">
|
||||
<% boolean interactiveProfile = editBean.isInteractive(curTunnel);
|
||||
%><option <%=(interactiveProfile == true ? "selected=\"selected\" " : "")%>value="interactive"><%=intl._("interactive connection")%> </option>
|
||||
<option <%=(interactiveProfile == false ? "selected=\"selected\" " : "")%>value="bulk"><%=intl._("bulk connection (downloads/websites/BT)")%> </option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="subdivider">
|
||||
<hr />
|
||||
</div>
|
||||
<% } // !streamrserver %>
|
||||
|
||||
<div id="optionsField" class="rowItem">
|
||||
<label><%=intl._("I2CP Options")%>:</label>
|
||||
</div>
|
||||
|
@ -1,3 +1,12 @@
|
||||
2010-06-26 zzz
|
||||
* I2PTunnel:
|
||||
- Move connection profile and delay connect to advanced config section
|
||||
- Add persistent client key support to SOCKS IRC
|
||||
- Fix display of interactive setting
|
||||
* jbigi, jcpuid: Suppress log messages when not in router context
|
||||
* jetty.xml: Add info on how to configure for following symlinks
|
||||
* logs.jsp: Add more JVM version info so we can distinguish OpenJDK from Sun
|
||||
|
||||
2010-06-16 zzz
|
||||
* Console: Sort countries with selected locale
|
||||
* FileUtil: Try to handle lack of unpack200 support more gracefully
|
||||
|
@ -18,7 +18,7 @@ public class RouterVersion {
|
||||
/** deprecated */
|
||||
public final static String ID = "Monotone";
|
||||
public final static String VERSION = CoreVersion.VERSION;
|
||||
public final static long BUILD = 2;
|
||||
public final static long BUILD = 3;
|
||||
|
||||
/** for example "-test" */
|
||||
public final static String EXTRA = "";
|
||||
|
Reference in New Issue
Block a user