| Modifier and Type | Field and Description |
|---|---|
protected static String | DEFAULT_DATAGRAM_HOSTDefault datagram host. |
protected static String | DEFAULT_DATAGRAM_PORTDefault datagram port. |
protected static int | DEFAULT_DATAGRAM_PORT_INTDefault datagram port int. |
(package private) static String | DEFAULT_SAM_CONFIGFILE |
static String | DEFAULT_SAM_KEYFILEDefault filename for persistent SAM private key storage. |
protected static String | DEFAULT_TCP_HOSTDefault TCP host. |
protected static String | DEFAULT_TCP_PORTDefault TCP port. |
static String | PROP_AUTHProperty to enable SAM bridge authentication. |
static String | PROP_DATAGRAM_HOSTProperty for the SAM datagram listen address. |
static String | PROP_DATAGRAM_PORTProperty for the SAM datagram listen port. |
static String | PROP_PW_PREFIXProperty prefix for SAM password hash entries. |
static String | PROP_PW_SUFFIXProperty suffix for SAM password hash entries. |
static String | PROP_TCP_HOSTProperty for the SAM TCP listen address. |
static String | PROP_TCP_PORTProperty for the SAM TCP listen port. |
| Constructor and Description |
|---|
SAMBridge(I2PAppContext context,
ClientAppManager mgr,
String[] args)For ClientApp interface. |
SAMBridge(String listenHost,
int listenPort,
boolean isSSL,
Properties i2cpProps,
String persistFile,
File configFile)Build a new SAM bridge. |
SAMBridge(String listenHost,
int listenPort,
boolean isSSL,
Properties i2cpProps,
String persistFile,
File configFile,
SAMSecureSessionInterface secureSession)Build a new SAM bridge. |
| Modifier and Type | Method and Description |
|---|---|
void | addKeystream(String name,
String stream)Specify that the given keystream should be used for the given name. |
String | getDisplayName()Return the display name |
int | getHandlerCount() |
(package private) SAMHandlerPool | getHandlerPool()Access the shared handler pool for v3 connections. |
String | getKeystream(String name)Retrieve the I2P private keystream for the given name, formatted
as a base64 string (Destination+PrivateKey+SessionPrivateKey, as I2CP
stores it). |
String | getName()Return the name |
int | getPoolActiveCount() |
int | getPoolRegisteredCount() |
int | getPoolSize() |
int | getQueueSize() |
int | getSessionCount() |
ClientAppState | getState()Return the state |
int | getStolenSocketCount()Count handlers whose socket has been stolen for data streaming. |
(package private) SAMv3DatagramServer | getV3DatagramServer(Properties props)Was a static singleton, now a singleton for this bridge. |
static void | main(String[] args)Usage: |
void | register(Handler handler)Handlers must call on startup |
void | renderSessionTableHTML(Writer out)Render the session table and handler summary as HTML. |
void | run()Accept incoming SAM connections and dispatch to handlers. |
void | saveConfig()Save the current configuration to disk. |
SAMSecureSessionInterface | secureSession()Returns the interactive Secure Session manager which requires SAM
applications to seek "approval" for their initial connections from the user
before they can start the session. |
void | shutdown(String[] args)As of 0.9.20, stops running handlers and sessions. |
void | startup()Start the bridge |
void | unregister(Handler handler)Handlers must call on stop |
(package private) void | unregisterHandlerFromPool(SAMv3Handler handler)Remove a v3 handler from the shared handler pool. |
protected static final String DEFAULT_DATAGRAM_HOST
protected static final String DEFAULT_DATAGRAM_PORT
protected static final int DEFAULT_DATAGRAM_PORT_INT
static final String DEFAULT_SAM_CONFIGFILE
public static final String DEFAULT_SAM_KEYFILE
protected static final String DEFAULT_TCP_HOST
protected static final String DEFAULT_TCP_PORT
public static final String PROP_AUTH
public static final String PROP_DATAGRAM_HOST
public static final String PROP_DATAGRAM_PORT
public static final String PROP_PW_PREFIX
public static final String PROP_PW_SUFFIX
public static final String PROP_TCP_HOST
public static final String PROP_TCP_PORT
public SAMBridge(I2PAppContext context, ClientAppManager mgr, String[] args) throws Exception
mgr - may be nullargs - non-nullException - on bad argspublic SAMBridge(String listenHost, int listenPort, boolean isSSL, Properties i2cpProps, String persistFile, File configFile)
listenHost - hostname to listen for SAM connections on ("0.0.0.0" for all)listenPort - port number to listen for SAM connections oni2cpProps - set of I2CP properties for finding and communicating with the routerpersistFile - location to store/load named keys to/fromRuntimeException - if a server socket can't be openedpublic SAMBridge(String listenHost, int listenPort, boolean isSSL, Properties i2cpProps, String persistFile, File configFile, SAMSecureSessionInterface secureSession)
listenHost - hostname to listen for SAM connections on ("0.0.0.0" for
all)listenPort - port number to listen for SAM connections oni2cpProps - set of I2CP properties for finding and communicating
with the routerpersistFile - location to store/load named keys to/fromsecureSession - an instance of a Secure Session to useRuntimeException - if a server socket can't be openedpublic void addKeystream(String name, String stream)
name - Name of the destinationstream - Base64-encoded private key stream (Destination+PrivateKey+SigningPrivateKey)public String getDisplayName()
getDisplayName in interface ClientApppublic int getHandlerCount()
SAMHandlerPool getHandlerPool()
public String getKeystream(String name)
name - Name of the destinationpublic String getName()
public int getPoolActiveCount()
public int getPoolRegisteredCount()
public int getPoolSize()
public int getQueueSize()
public int getSessionCount()
public ClientAppState getState()
public int getStolenSocketCount()
SAMv3DatagramServer getV3DatagramServer(Properties props) throws IOException
props - non-null instantiate and start server if it doesn't existIOException - if can't bind to host/port, or if different than existingpublic static void main(String[] args)
SAMBridge [ keyfile [listenHost ] listenPort [ name=val ]* ]or:
SAMBridge [ name=val ]*name=val options are passed to the I2CP code to build a session, allowing the bridge to specify an alternate I2CP host and port, tunnel depth, etc.
args - [ keyfile [ listenHost ] listenPort [ name=val ]* ]public void register(Handler handler)
public void renderSessionTableHTML(Writer out) throws IOException
out - non-nullIOException - if the writer failspublic void run()
public void saveConfig()
throws IOExceptionIOException - if the config file cannot be writtenpublic SAMSecureSessionInterface secureSession()
public void shutdown(String[] args)
public void startup()
throws IOExceptionstartup in interface ClientAppIOExceptionpublic void unregister(Handler handler)
void unregisterHandlerFromPool(SAMv3Handler handler)
handler - non-null