mirror of
https://github.com/wownero/i2p-zero.git
synced 2026-10-17 15:21:40 +02:00
added highres icon
This commit is contained in:
@@ -85,6 +85,10 @@ Note that it may take a short while for new tunnels to be set up.
|
||||
|
||||
Call the `dist/linux/router/bin/tunnel-control.sh` script as follows to create and destroy tunnels:
|
||||
|
||||
#### Get the router reachability status. Returns a string such as "testing", "firewalled", "running", "error"
|
||||
|
||||
`tunnel-control.sh router.reachability`
|
||||
|
||||
#### Listen for I2P connections and forward them to the specified host and port. Returns the I2P base 32 destination address for the server tunnel created.
|
||||
|
||||
Optionally, specify a directory for storing/reading the server key file.
|
||||
|
||||
@@ -42,6 +42,10 @@ public class RouterWrapper {
|
||||
}
|
||||
}
|
||||
|
||||
public Router getRouter() {
|
||||
return router;
|
||||
}
|
||||
|
||||
public void copyFolderRecursively(Path src, Path dest) {
|
||||
try {
|
||||
Files.walk(src).forEach(source -> {
|
||||
@@ -81,7 +85,7 @@ public class RouterWrapper {
|
||||
}
|
||||
}
|
||||
|
||||
tunnelControl = new TunnelControl(router, i2PConfigDir, new File(i2PConfigDir, "tunnelTemp"));
|
||||
tunnelControl = new TunnelControl(this, i2PConfigDir, new File(i2PConfigDir, "tunnelTemp"));
|
||||
new Thread(tunnelControl).start();
|
||||
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ import java.util.stream.Stream;
|
||||
|
||||
public class TunnelControl implements Runnable {
|
||||
|
||||
private Router router;
|
||||
private RouterWrapper routerWrapper;
|
||||
private boolean stopping = false;
|
||||
private ServerSocket controlServerSocket;
|
||||
private File tunnelControlConfigDir;
|
||||
@@ -138,8 +138,8 @@ public class TunnelControl implements Runnable {
|
||||
}
|
||||
}
|
||||
|
||||
public TunnelControl(Router router, File tunnelControlConfigDir, File tunnelControlTempDir) {
|
||||
this.router = router;
|
||||
public TunnelControl(RouterWrapper routerWrapper, File tunnelControlConfigDir, File tunnelControlTempDir) {
|
||||
this.routerWrapper = routerWrapper;
|
||||
tunnelControlTempDir.delete();
|
||||
tunnelControlTempDir.mkdir();
|
||||
|
||||
@@ -399,9 +399,14 @@ public class TunnelControl implements Runnable {
|
||||
break;
|
||||
}
|
||||
|
||||
case "router.reachability": {
|
||||
out.println(routerWrapper.getReachability().getMessage());
|
||||
break;
|
||||
}
|
||||
|
||||
case "sam.create": {
|
||||
String[] samArgs = new String[]{"sam.keys", "127.0.0.1", "7656", "i2cp.tcp.host=127.0.0.1", "i2cp.tcp.port=7654"};
|
||||
I2PAppContext context = router.getContext();
|
||||
I2PAppContext context = routerWrapper.getRouter().getContext();
|
||||
ClientAppManager mgr = new ClientAppManagerImpl(context);
|
||||
SAMBridge samBridge = new SAMBridge(context, mgr, samArgs);
|
||||
samBridge.startup();
|
||||
|
||||
Reference in New Issue
Block a user