Logging
, EventDispatcher
public class I2PTunnel extends EventDispatcherImpl implements Logging
修飾子とタイプ | クラス | 説明 |
---|---|---|
static interface |
I2PTunnel.ConnectionEventListener |
Callback routine to find out
|
修飾子とタイプ | フィールド | 説明 |
---|---|---|
java.lang.String |
host |
the I2CP host, non-null
|
java.lang.String |
listenHost |
the listen-on host.
|
boolean |
ownDest |
|
static int |
PACKET_DELAY |
|
java.lang.String |
port |
the I2CP port, non-null
|
long |
readTimeout |
コンストラクタ | 説明 |
---|---|
I2PTunnel() |
Standard constructor for embedded, uses args "-nocli -die" to return immediately
|
I2PTunnel(java.lang.String[] args) |
See usage() for options
|
I2PTunnel(java.lang.String[] args,
I2PTunnel.ConnectionEventListener lsnr) |
See usage() for options
|
修飾子とタイプ | メソッド | 説明 |
---|---|---|
void |
addConnectionEventListener(I2PTunnel.ConnectionEventListener lsnr) |
|
(package private) void |
addSession(I2PSession session) |
|
static Destination |
destFromName(java.lang.String name) |
推奨されていません。
Don't use i2ptunnel for lookup! Use I2PAppContext.getGlobalContext().namingService().lookup(name) from i2p.jar
|
java.util.Properties |
getClientOptions() |
Generic options used for clients and servers.
|
I2PAppContext |
getContext() |
|
(package private) java.util.List<I2PSession> |
getSessions() |
|
void |
log(java.lang.String s) |
Log the given message (using both the logging subsystem and standard output...)
|
static void |
main(java.lang.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(java.lang.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(java.lang.String[] args,
Logging l) |
Configure the extra I2CP options to use in any subsequent I2CP sessions.
|
void |
runClose(java.lang.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(java.lang.String cmd,
Logging l) |
|
void |
runConnectClient(java.lang.String[] args,
Logging l) |
Run a CONNECT client on the given port number
|
void |
runHttpBidirServer(java.lang.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(java.lang.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(java.lang.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(java.lang.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(java.lang.String[] args,
Logging l) |
Same args as runServer
(we should stop duplicating all this code...)
|
void |
runListenOn(java.lang.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(java.lang.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(java.lang.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(java.lang.String[] args,
Logging l) |
Run an SOCKS IRC tunnel on the given port number
|
void |
runSOCKSTunnel(java.lang.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(java.lang.String[] args,
Logging l) |
Streamr client
|
void |
runStreamrServer(java.lang.String[] args,
Logging l) |
Streamr server
|
void |
runTextServer(java.lang.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(java.util.Properties opts) |
Generic options used for clients and servers.
|
attachEventDispatcher, detachEventDispatcher, getEventDispatcher, getEvents, getEventValue, ignoreEvents, notifyEvent, unIgnoreEvents, waitEventValue
public static final int PACKET_DELAY
public boolean ownDest
public java.lang.String port
public java.lang.String host
public java.lang.String listenHost
public long readTimeout
public I2PTunnel()
public I2PTunnel(java.lang.String[] args)
java.lang.IllegalArgumentException
public I2PTunnel(java.lang.String[] args, I2PTunnel.ConnectionEventListener lsnr)
lsnr
- may be nulljava.lang.IllegalArgumentException
public static void main(java.lang.String[] args)
java.util.List<I2PSession> getSessions()
void addSession(I2PSession session)
session
- null okvoid removeSession(I2PSession session)
session
- null okpublic java.util.Properties getClientOptions()
public void runCommand(java.lang.String cmd, Logging l)
public void runClientOptions(java.lang.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(java.util.Properties opts)
opts
- non-nullpublic void runServer(java.lang.String[] args, Logging l)
Sets the event "serverTaskId" = Integer(taskId) after the tunnel has been started (or -1 on error) Also sets the event "openServerResult" = "ok" or "error" (displaying "Ready!" on the logger after 'ok'). So, success = serverTaskId != -1 and openServerResult = ok.
args
- {hostname, portNumber, privKeyFilename}l
- logger to receive events and outputjava.lang.IllegalArgumentException
- on config problempublic void runIrcServer(java.lang.String[] args, Logging l)
java.lang.IllegalArgumentException
- on config problempublic void runHttpServer(java.lang.String[] args, Logging l)
Sets the event "serverTaskId" = Integer(taskId) after the tunnel has been started (or -1 on error) Also sets the event "openServerResult" = "ok" or "error" (displaying "Ready!" on the logger after 'ok'). So, success = serverTaskId != -1 and openServerResult = ok.
args
- {hostname, portNumber, spoofedHost, privKeyFilename}l
- logger to receive events and outputjava.lang.IllegalArgumentException
- on config problempublic void runHttpBidirServer(java.lang.String[] args, Logging l)
Sets the event "serverTaskId" = Integer(taskId) after the tunnel has been started (or -1 on error) Also sets the event "openServerResult" = "ok" or "error" (displaying "Ready!" on the logger after 'ok'). So, success = serverTaskId != -1 and openServerResult = ok.
args
- {hostname, portNumber, proxyPortNumber, spoofedHost, privKeyFilename}l
- logger to receive events and outputjava.lang.IllegalArgumentException
- on config problempublic void runTextServer(java.lang.String[] args, Logging l)
Deprecated? Why run a server with a private destination? Not available from the war GUI Sets the event "serverTaskId" = Integer(taskId) after the tunnel has been started (or -1 on error) Also sets the event "openServerResult" = "ok" or "error" (displaying "Ready!" on the logger after 'ok'). So, success = serverTaskId != -1 and openServerResult = ok.
args
- {hostname, portNumber, privKeyBase64}l
- logger to receive events and outputjava.lang.IllegalArgumentException
- on config problempublic void runClient(java.lang.String[] args, Logging l)
args
- {portNumber, destinationBase64 or "file:filename"[, sharedClient [, privKeyFile]]}l
- logger to receive events and outputjava.lang.IllegalArgumentException
- on config problempublic void runHttpClient(java.lang.String[] args, Logging l)
args
- {portNumber[, sharedClient][, proxy to be used for the WWW]}l
- logger to receive events and outputjava.lang.IllegalArgumentException
- on config problempublic void runConnectClient(java.lang.String[] args, Logging l)
args
- {portNumber[, sharedClient][, proxy to be used for the WWW]}l
- logger to receive events and outputjava.lang.IllegalArgumentException
- on config problempublic void runIrcClient(java.lang.String[] args, Logging l)
args
- {portNumber,destinationBase64 or "file:filename" [, sharedClient [, privKeyFile]]}l
- logger to receive events and outputjava.lang.IllegalArgumentException
- on config problempublic void runSOCKSTunnel(java.lang.String[] args, Logging l)
args
- {portNumber [, sharedClient]} or (portNumber, ignored (false), privKeyFile)l
- logger to receive events and outputjava.lang.IllegalArgumentException
- on config problempublic void runSOCKSIRCTunnel(java.lang.String[] args, Logging l)
args
- {portNumber [, sharedClient]} or (portNumber, ignored (false), privKeyFile)java.lang.IllegalArgumentException
- on config problempublic void runStreamrClient(java.lang.String[] args, Logging l)
args
- {targethost, targetport, destinationString}l
- logger to receive events and outputjava.lang.IllegalArgumentException
- on config problempublic void runStreamrServer(java.lang.String[] args, Logging l)
args
- {port, privkeyfile}l
- logger to receive events and outputjava.lang.IllegalArgumentException
- on config problempublic void runListenOn(java.lang.String[] args, Logging l)
args
- {hostname}l
- logger to receive events and outputpublic void runReadTimeout(java.lang.String[] args, Logging l)
args
- {hostname}l
- logger to receive events and outputpublic void runClose(java.lang.String[] args, Logging l)
args
- {jobNumber}, {"forced", jobNumber}, {"forced", "all"}, {"destroy", jobNumber}, {"destroy", "all"}l
- logger to receive events and outputpublic void log(java.lang.String s)
@Deprecated public static Destination destFromName(java.lang.String name) throws DataFormatException
public void addConnectionEventListener(I2PTunnel.ConnectionEventListener lsnr)
public void removeConnectionEventListener(I2PTunnel.ConnectionEventListener lsnr)
public I2PAppContext getContext()
void routerDisconnected()