public class TunnelController extends Object implements Logging
Constructor and Description |
---|
TunnelController(Properties config,
String prefix)
Create a new controller for a tunnel out of the specific config options.
|
TunnelController(Properties config,
String prefix,
boolean createKey)
Defaults in config properties are not recommended, they may or may not be honored.
|
Modifier and Type | Method and Description |
---|---|
List<String> |
clearMessages()
Pull off any messages that the I2PTunnel has produced
|
void |
destroyTunnel()
May NOT be restarted with restartTunnel() or startTunnel() later.
|
Properties |
getClientOptionProps()
These are the ones stored with a prefix of "option."
Defaults in config properties are not honored.
|
String |
getClientOptions()
Deprecated.
why would you want this? Use getClientOptionProps() instead
|
Properties |
getConfig(String prefix) |
String |
getDescription() |
Destination |
getDestination()
Returns null if not running.
|
String |
getI2CPHost() |
String |
getI2CPPort() |
boolean |
getIsRunning() |
boolean |
getIsStandby()
if running but no open sessions, we are in standby
|
boolean |
getIsStarting() |
String |
getListenOnInterface() |
String |
getListenPort() |
String |
getMyDestHashBase32()
Returns null if not running.
|
String |
getMyDestination()
Returns null if not running.
|
String |
getName() |
boolean |
getPersistentClientKey() |
File |
getPrivateKeyFile()
Does not necessarily exist.
|
String |
getPrivKeyFile()
Probably not absolute.
|
String |
getProxyList() |
String |
getSharedClient()
default true
|
String |
getSpoofedHost() |
boolean |
getStartOnLoad()
default true
|
void |
getSummary(StringBuilder buf)
Deprecated.
unused
|
String |
getTargetDestination() |
String |
getTargetHost() |
String |
getTargetPort() |
String |
getType() |
boolean |
isClient()
Is it a client or server in the UI and I2P side?
Note that a streamr client is a UI and I2P client but a server on the localhost side.
|
static boolean |
isClient(String type)
Is it a client or server in the UI and I2P side?
Note that a streamr client is a UI and I2P client but a server on the localhost side.
|
void |
log(String s) |
void |
restartTunnel() |
void |
setConfig(Properties config,
String prefix)
As of 0.9.1, updates the options on an existing session
|
void |
startTunnel()
Start up the tunnel (if it isn't already running)
|
void |
startTunnelBackground() |
void |
stopTunnel()
May be restarted with restartTunnel() or startTunnel() later.
|
String |
toString() |
public static final String KEY_BACKUP_DIR
public static final String PROP_DESCR
public static final String PROP_DEST
public static final String PROP_I2CP_HOST
public static final String PROP_I2CP_PORT
public static final String PROP_INTFC
public static final String PROP_FILE
public static final String PROP_LISTEN_PORT
public static final String PROP_NAME
public static final String PROP_PROXIES
public static final String PROP_SHARED
public static final String PROP_SPOOFED_HOST
public static final String PROP_START
public static final String PROP_TARGET_HOST
public static final String PROP_TARGET_PORT
public static final String PROP_TYPE
public static final String PFX_OPTION
public static final String OPT_BUNDLE_REPLY
public static final String TYPE_CONNECT
public static final String TYPE_HTTP_BIDIR_SERVER
public static final String TYPE_HTTP_CLIENT
public static final String TYPE_HTTP_SERVER
public static final String TYPE_IRC_CLIENT
public static final String TYPE_IRC_SERVER
public static final String TYPE_SOCKS
public static final String TYPE_SOCKS_IRC
public static final String TYPE_STD_CLIENT
public static final String TYPE_STD_SERVER
public static final String TYPE_STREAMR_CLIENT
public static final String TYPE_STREAMR_SERVER
public static final SigType PREFERRED_SIGTYPE
public TunnelController(Properties config, String prefix)
config
- original key=value mapping non-nullprefix
- beginning of key values that are relevant to this tunnelpublic TunnelController(Properties config, String prefix, boolean createKey)
config
- original key=value mapping non-nullprefix
- beginning of key values that are relevant to this tunnelcreateKey
- for servers, whether we want to create a brand new destination
with private keys at the location specified or not (does not
overwrite existing ones)public void startTunnelBackground()
public void startTunnel()
public Properties getClientOptionProps()
public void stopTunnel()
public void destroyTunnel()
public void restartTunnel()
public void setConfig(Properties config, String prefix)
public Properties getConfig(String prefix)
public String getType()
public String getName()
public String getDescription()
public String getI2CPHost()
public String getI2CPPort()
public boolean isClient()
public static boolean isClient(String type)
@Deprecated public String getClientOptions()
public String getListenOnInterface()
public String getTargetHost()
public String getTargetPort()
public String getSpoofedHost()
public String getPrivKeyFile()
public String getListenPort()
public String getTargetDestination()
public String getProxyList()
public String getSharedClient()
public boolean getStartOnLoad()
public boolean getPersistentClientKey()
public File getPrivateKeyFile()
public String getMyDestination()
public String getMyDestHashBase32()
public Destination getDestination()
public boolean getIsRunning()
public boolean getIsStarting()
public boolean getIsStandby()
@Deprecated public void getSummary(StringBuilder buf)
public List<String> clearMessages()