|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.i2p.util.EventDispatcherImpl
net.i2p.i2ptunnel.I2PTunnel
public class I2PTunnel
An I2PTunnel tracks one or more I2PTunnelTasks and one or more I2PSessions. Usually one of each. TODO: Most events are not listened to elsewhere, so error propagation is poor
Nested Class Summary | |
---|---|
static interface |
I2PTunnel.ConnectionEventListener
Callback routine to find out |
Field Summary | |
---|---|
String |
host
the I2CP host, non-null |
String |
listenHost
the listen-on host. |
boolean |
ownDest
|
static int |
PACKET_DELAY
|
String |
port
the I2CP port, non-null |
long |
readTimeout
|
Constructor Summary | |
---|---|
I2PTunnel()
Standard constructor for embedded, uses args "-nocli -die" to return immediately |
|
I2PTunnel(String[] args)
See usage() for options |
|
I2PTunnel(String[] args,
I2PTunnel.ConnectionEventListener lsnr)
See usage() for options |
Method Summary | |
---|---|
void |
addConnectionEventListener(I2PTunnel.ConnectionEventListener lsnr)
|
(package private) void |
addSession(I2PSession session)
|
static Destination |
destFromName(String name)
Deprecated. Don't use i2ptunnel for lookup! Use I2PAppContext.getGlobalContext().namingService().lookup(name) from i2p.jar |
Properties |
getClientOptions()
Generic options used for clients and servers. |
I2PAppContext |
getContext()
|
(package private) List<I2PSession> |
getSessions()
|
void |
log(String s)
Log the given message (using both the logging subsystem and standard output...) |
static void |
main(String[] args)
|
void |
removeConnectionEventListener(I2PTunnel.ConnectionEventListener lsnr)
|
(package private) void |
removeSession(I2PSession session)
|
(package private) void |
routerDisconnected()
Call this whenever we lose touch with the router involuntarily (aka the router is off / crashed / etc) |
void |
runClient(String[] args,
Logging l)
Run the client on the given port number pointing at the specified destination (either the base64 of the destination or file:fileNameContainingDestination). |
void |
runClientOptions(String[] args,
Logging l)
Configure the extra I2CP options to use in any subsequent I2CP sessions. |
void |
runClose(String[] args,
Logging l)
Close the given task (or all tasks), optionally forcing them to die a hard death Sets the event "closeResult" = "ok" after the closing is complete |
void |
runCommand(String cmd,
Logging l)
|
void |
runConnectClient(String[] args,
Logging l)
Run a CONNECT client on the given port number |
void |
runHttpBidirServer(String[] args,
Logging l)
Run the HTTP server pointing at the host and port specified using the private i2p destination loaded from the specified file, replacing the HTTP headers so that the Host: specified is the one spoofed. |
void |
runHttpClient(String[] args,
Logging l)
Run an HTTP client on the given port number Sets the event "httpclientTaskId" = Integer(taskId) after the tunnel has been started (or -1 on error). |
void |
runHttpServer(String[] args,
Logging l)
Run the HTTP server pointing at the host and port specified using the private i2p destination loaded from the specified file, replacing the HTTP headers so that the Host: specified is the one spoofed. |
void |
runIrcClient(String[] args,
Logging l)
Run an IRC client on the given port number Sets the event "ircclientTaskId" = Integer(taskId) after the tunnel has been started (or -1 on error). |
void |
runIrcServer(String[] args,
Logging l)
Same args as runServer (we should stop duplicating all this code...) |
void |
runListenOn(String[] args,
Logging l)
Specify the hostname / IP address of the interface that the tunnels should bind to Sets the event "listen_onResult" = "ok" or "error" after the interface has been specified |
void |
runReadTimeout(String[] args,
Logging l)
Specify the read timeout going to be used for newly-created I2PSockets Sets the event "read_timeoutResult" = "ok" or "error" after the interface has been specified |
void |
runServer(String[] args,
Logging l)
Run the server pointing at the host and port specified using the private i2p destination loaded from the specified file. |
void |
runSOCKSIRCTunnel(String[] args,
Logging l)
Run an SOCKS IRC tunnel on the given port number |
void |
runSOCKSTunnel(String[] args,
Logging l)
Run an SOCKS tunnel on the given port number Sets the event "sockstunnelTaskId" = Integer(taskId) after the tunnel has been started (or -1 on error). |
void |
runStreamrClient(String[] args,
Logging l)
Streamr client |
void |
runStreamrServer(String[] args,
Logging l)
Streamr server |
void |
runTextServer(String[] args,
Logging l)
Run the server pointing at the host and port specified using the private i2p destination loaded from the given base64 stream. |
void |
setClientOptions(Properties opts)
Generic options used for clients and servers. |
Methods inherited from class net.i2p.util.EventDispatcherImpl |
---|
attachEventDispatcher, detachEventDispatcher, getEventDispatcher, getEvents, getEventValue, ignoreEvents, notifyEvent, unIgnoreEvents, waitEventValue |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int PACKET_DELAY
public boolean ownDest
public String port
public String host
public String listenHost
public long readTimeout
Constructor Detail |
---|
public I2PTunnel()
public I2PTunnel(String[] args)
IllegalArgumentException
public I2PTunnel(String[] args, I2PTunnel.ConnectionEventListener lsnr)
lsnr
- may be null
IllegalArgumentException
Method Detail |
---|
public static void main(String[] args)
List<I2PSession> getSessions()
void addSession(I2PSession session)
session
- null okvoid removeSession(I2PSession session)
session
- null okpublic Properties getClientOptions()
public void runCommand(String cmd, Logging l)
public void runClientOptions(String[] args, Logging l)
args
- each args[i] is a key=value pair to add to the optionsl
- logger to receive events and outputpublic void setClientOptions(Properties opts)
opts
- non-nullpublic void runServer(String[] args, Logging l)
args
- {hostname, portNumber, privKeyFilename}l
- logger to receive events and output
IllegalArgumentException
- on config problempublic void runIrcServer(String[] args, Logging l)
IllegalArgumentException
- on config problempublic void runHttpServer(String[] args, Logging l)
args
- {hostname, portNumber, spoofedHost, privKeyFilename}l
- logger to receive events and output
IllegalArgumentException
- on config problempublic void runHttpBidirServer(String[] args, Logging l)
args
- {hostname, portNumber, proxyPortNumber, spoofedHost, privKeyFilename}l
- logger to receive events and output
IllegalArgumentException
- on config problempublic void runTextServer(String[] args, Logging l)
args
- {hostname, portNumber, privKeyBase64}l
- logger to receive events and output
IllegalArgumentException
- on config problempublic void runClient(String[] args, Logging l)
args
- {portNumber, destinationBase64 or "file:filename"[, sharedClient [, privKeyFile]]}l
- logger to receive events and output
IllegalArgumentException
- on config problempublic void runHttpClient(String[] args, Logging l)
args
- {portNumber[, sharedClient][, proxy to be used for the WWW]}l
- logger to receive events and output
IllegalArgumentException
- on config problempublic void runConnectClient(String[] args, Logging l)
args
- {portNumber[, sharedClient][, proxy to be used for the WWW]}l
- logger to receive events and output
IllegalArgumentException
- on config problempublic void runIrcClient(String[] args, Logging l)
args
- {portNumber,destinationBase64 or "file:filename" [, sharedClient [, privKeyFile]]}l
- logger to receive events and output
IllegalArgumentException
- on config problempublic void runSOCKSTunnel(String[] args, Logging l)
args
- {portNumber [, sharedClient]} or (portNumber, ignored (false), privKeyFile)l
- logger to receive events and output
IllegalArgumentException
- on config problempublic void runSOCKSIRCTunnel(String[] args, Logging l)
args
- {portNumber [, sharedClient]} or (portNumber, ignored (false), privKeyFile)
IllegalArgumentException
- on config problempublic void runStreamrClient(String[] args, Logging l)
args
- {targethost, targetport, destinationString}l
- logger to receive events and output
IllegalArgumentException
- on config problempublic void runStreamrServer(String[] args, Logging l)
args
- {port, privkeyfile}l
- logger to receive events and output
IllegalArgumentException
- on config problempublic void runListenOn(String[] args, Logging l)
args
- {hostname}l
- logger to receive events and outputpublic void runReadTimeout(String[] args, Logging l)
args
- {hostname}l
- logger to receive events and outputpublic void runClose(String[] args, Logging l)
args
- {jobNumber}, {"forced", jobNumber}, {"forced", "all"}, {"destroy", jobNumber}, {"destroy", "all"}l
- logger to receive events and outputpublic void log(String s)
log
in interface Logging
public static Destination destFromName(String name) throws DataFormatException
DataFormatException
public void addConnectionEventListener(I2PTunnel.ConnectionEventListener lsnr)
public void removeConnectionEventListener(I2PTunnel.ConnectionEventListener lsnr)
public I2PAppContext getContext()
void routerDisconnected()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |