java.lang.Object
net.i2p.i2ptunnel.ui.TunnelConfig
Helper class to generate a valid TunnelController configuration from provided settings.
This class is also used by Android. Maintain as a stable API and take care not to break Android.
Field Summary
Modifier and TypeFieldDescriptionprivate booleanWhether a new client entry was submitted.private static final String[]On/off options shown for client tunnels.On/off options read from the config.private static final String[]On/off options shown for proxy tunnels.private static final String[]On/off options shown for server tunnels.private String[]Client authorization keys, base64.private String[]Client authorization names, base64.Indices of the client entries to remove.private booleanWhether the tunnel starts with a delay.protected final I2PAppContextApp context, for the global context and key generation.private StringExtra I2CP options typed by the user.private StringThe tunnel's description.private DestinationThe tunnel's destination, for server tunnels.private intEncryption level requested for the tunnel.private StringAccess filter definition for the tunnel.private static final String[]Options specific to the http server tunnel.private StringHost of the I2CP router.private StringPort of the I2CP router.private StringThe tunnel's display name.private StringKey for a newly added client entry.private StringName for a newly added client entry.private StringPassword for the proxy's basic auth.private StringUser name for the proxy's basic auth.Non proxy no show set.private static final String[]Options hidden from the tunnel config form.No show set.private static final String[]Valued options shown for client tunnels.Valued options read from the config.private static final String[]Do NOT add these to noShoOpts, we must leave them in for HTTPClient, Connect, and SOCKS so they will get migrated to MD5 / SHA256 digest authentication.private static final String[]Valued options shown for server tunnels.private intLocal port the tunnel listens on.private StringFile holding the tunnel's private keys.private StringAdvanced profile name for the tunnel.private StringProxy list for the browsing proxy.private StringRestriction on who may connect to the tunnel.private booleanWhether the client tunnel is shared.private intMaximum shutdown delay in seconds for server tunnels @since 0.9.68+.private intMinimum shutdown delay in seconds for server tunnels @since 0.9.68+.private StringHost name the server tunnel claims.private booleanWhether the tunnel starts when the router boots.private intMaximum startup delay in seconds for server tunnels @since 0.9.68+.private intMinimum startup delay in seconds for server tunnels @since 0.9.68+.private StringDestination of the peer tunnel, for client tunnels.private StringHost the client tunnel connects to.private intPort the client tunnel connects to.private intBackup inbound tunnels, -1 for the default.private intBackup outbound tunnels, -1 for the default.private intInbound tunnel depth, -1 for the default.private intOutbound tunnel depth, -1 for the default.private intInbound tunnel count, -1 for the default.private intOutbound tunnel count, -1 for the default.private intInbound tunnel variance, -4 for the default.private intOutbound tunnel variance, -4 for the default.private StringThe tunnel type name.private static final StringPrefix shared by the tunnel option keys.protected static final StringEnables the access list as a whitelist, servers only.protected static final StringEnables the access list as a blacklist, servers only.static final StringDaily connection limit.static final StringHourly connection limit.static final StringStreaming connection limit properties, moved from IndexBean.static final StringConcurrent stream limit.static final StringDaily total connection limit, across all peers.static final StringHourly total connection limit, across all peers.static final StringMinute total connection limit, across all peers.static final StringNickname for the shared client tunnel config.Constructor Summary
ConstructorsMethod Summary
Modifier and TypeMethodDescriptionvoidaddClientKeys(String[] s) Multiple entries in form Handles either order addClientName/addClientKey.voidaddClientNames(String[] s) Multiple entries in form.private voidaddLeaseSetPrivKey(Properties config, boolean isBlinded) Servers only.Based on all provided data, create a set of configuration parameters suitable for use in a TunnelController.The filename of the private key file.intReturns the configured maximum shutdown delay.intReturns the configured minimum shutdown delay.intReturns the configured maximum startup delay.intReturns the configured minimum startup delay.getType()The type of tunnel.voidHandles either order newClientName/newClientKey.voidHandles either order newClientName/newClientKey.parseCustomOptions(String args) Parse the args submitted in the custom options field.private voidprocessEncryptMode(Properties config) Servers only.voidrevokeClients(String[] s) Multiple entries in form.voidsetAccessList(String val) Comma-separated list of destinations to whitelist or blacklist.voidsetAccessMode(int mode) Controls how other tunnels are checked for access.voidsetAddClient(boolean val) Generate an extra per-client key, as for encrypt modes 6-9.voidsetAllowAccept(boolean val) Allow the Accept header to pass through the HTTP client.voidsetAllowInternalSSL(boolean val) Allow SSL connections through the HTTP client.voidsetAllowReferer(boolean val) Allow the Referer header to pass through the HTTP client.voidsetAllowUserAgent(boolean val) Allow the User-Agent header to pass through the HTTP client.voidsetAltPrivKeyFile(String file) What filename is this server tunnel's alternate private keys stored in.voidSet the secret required to decrypt hidden encrypted LeaseSets.voidsetClientHost(String host) I2CP host the router is on, ignored when in router context.voidsetClientPort(String port) I2CP port the router is on, ignored when in router context.private voidsetClientServerConfig(Properties config) Set the interface or target host and the generic client or server options, including the encryption mode for servers.voidsetClose(boolean val) Close connections when idle.voidsetCloseTime(int val) Idle time in minutes before closing connections.voidsetConnectDelay(boolean val) Delay the connection to the target until the first client connects.voidsetCustomOptions(String customOptions) What I2P session overrides should be used.voidsetDCC(boolean val) Allow DCC in IRC clients.voidsetDelayOpen(boolean val) Delay opening to the target until the first client connects.voidsetDescription(String description) One line description.voidsetDestination(Destination dest) This is easier than requiring TunnelConfig to talk to TunnelControllerGroup and TunnelController.private voidsetDestinationConfig(Properties config) Set the destination, spoofed host, bidirectional server interface, and IRC DCC options.voidsetEncrypt(boolean val) Encrypt the lease set.voidsetEncryptKey(String val) Key for encrypting the lease set.voidsetEncryptMode(int mode) Set the lease set encryption mode.voidsetEncType(String val) Adds to existing, comma separated.voidsetFilterDefinition(String filterDefinition) Set the filter definition.voidRandom key for inbound tunnels.voidsetJumpList(String val) Comma-separated list of HTTP outproxy jump servers.voidPrivate key used to encrypt the lease set.voidPrivate key used to sign the lease set.voidsetLimitDay(int val) Max connections per day.voidsetLimitHour(int val) Max connections per hour.voidsetLimitMinute(int val) Max connections per minute.voidsetMaxStreams(int val) Max concurrent streams.voidsetMultihome(boolean val) Bundle reply info for multihoming.voidShort name of the tunnel.voidsetNewDest(int mode) Controls how ephemeral the I2P Destination of a client tunnel is.voidRandom key for outbound tunnels.voidsetOutproxyAuth(boolean val) Sets whether authentication is required for any of the configured outproxies.voidPassword for outproxy authentication.voidSet the type of the outproxy.voidUsername for outproxy authentication.private voidsetPerClientKeys(Properties config) Add the per-client PSK or DH keys for encrypt modes 6-9, generating new keys as needed.private voidsetPersistentKeysConfig(Properties config) Add persistent random keys and lease set signing and encryption keys for non-client tunnels and clients with persistent keys.voidsetPort(int port) What port should this client/httpclient/ircclient listen on.voidsetPostBanTime(int val) POST ban duration in minutes.voidsetPostCheckTime(int val) POST check window in minutes.voidsetPostMax(int val) POST limits.voidsetPostTotalBanTime(int val) Total POST ban duration in minutes.voidsetPostTotalMax(int val) Max total POST requests in the check window.voidsetPrivKeyFile(String file) Set the private key filename for this server tunnel.voidsetProfile(String profile) Streaming profile, only "interactive" has an effect.voidsetProxyAuth(String authType) Sets whether authentication should be used for client proxy tunnels.voidsetProxyList(String proxyList) What HTTP outproxies should be used (httpclient specific).private voidsetProxyOptions(Properties config) Set the outproxy list and migrate or add proxy authentication digests for HTTP, CONNECT, and SOCKS tunnels.voidPassword for client proxy authentication.voidUsername for client proxy authentication.voidsetReachableBy(String reachableBy) What interface should this client/httpclient/ircclient listen on.voidsetReduce(boolean val) Reduce the number of connections when idle.voidsetReduceCount(int val) Number of connections to reduce to when idle.voidsetReduceTime(int val) Idle time in minutes before reducing connections.voidsetRejectInproxy(boolean val) Reject requests from inproxies.voidsetRejectReferer(boolean val) Reject requests carrying a Referer header.voidsetRejectUserAgents(boolean val) Reject requests whose User-Agent matches the blocklist.voidsetShared(boolean val) Share the private key with other client tunnels.voidsetShutdownDelayMax(int val) The maximum shutdown delay in seconds for server tunnels.voidsetShutdownDelayMin(int val) The minimum shutdown delay in seconds for server tunnels.voidsetSigType(String val) Signature type for the destination.voidsetSpoofedHost(String host) What host does this http server tunnel spoof.voidComma-separated list of SSL-capable outproxies.voidsetStartOnLoad(boolean val) If called with any value, we want this tunnel to start whenever it is loaded (aka right now and whenever the router is started up).voidsetStartupDelayMax(int val) The maximum startup delay in seconds for server tunnels.voidsetStartupDelayMin(int val) The minimum startup delay in seconds for server tunnels.voidsetTargetDestination(String dest) What peer does this client tunnel point at.voidsetTargetHost(String host) What host does this server tunnel point at.voidsetTargetPort(int port) What port does this server tunnel point at.voidsetTotalDay(int val) Max total connections per day.voidsetTotalHour(int val) Max total connections per hour.voidsetTotalMinute(int val) Max total connections per minute.voidsetTunnelBackupQuantity(int tunnelBackupQuantity) How many tunnels to hold in reserve to guard against failures In or both in/out.voidsetTunnelBackupQuantityOut(int tunnelBackupQuantity) How many tunnels to hold in reserve to guard against failures.voidsetTunnelDepth(int tunnelDepth) How many hops to use for inbound tunnels In or both in/out.voidsetTunnelDepthOut(int tunnelDepth) How many hops to use for outbound tunnels.voidsetTunnelQuantity(int tunnelQuantity) How many parallel inbound tunnels to use In or both in/out.voidsetTunnelQuantityOut(int tunnelQuantity) How many parallel outbound tunnels to use.voidsetTunnelVariance(int tunnelVariance) How much randomisation to apply to the depth of tunnels In or both in/out.voidsetTunnelVarianceOut(int tunnelVariance) How much randomisation to apply to the depth of outbound tunnels.voidWhat type of tunnel (httpclient, ircclient, client, or server).voidsetUniqueLocal(boolean val) Assign unique local hostnames for destination lookup.voidsetUseOutproxyPlugin(boolean val) Use the outproxy plugin for HTTP requests.voidsetUserAgents(String val) Set the User-Agent blocklist.voidsetUseSSL(boolean val) Use SSL on the server port.private voidupdateConfigGeneric(Properties config) Writes the shared tunnel settings into the config.voidupdateTunnelQuantities(Properties config) Update tunnel quantities for the provided config from this TunnelConfig.
Field Details
SHARED_CLIENT_NICKNAME
Nickname for the shared client tunnel config.- See Also:
OPT
Prefix shared by the tunnel option keys.- See Also:
_context
App context, for the global context and key generation._type
The tunnel type name._name
The tunnel's display name._description
The tunnel's description._i2cpHost
Host of the I2CP router._i2cpPort
Port of the I2CP router._tunnelDepth
private int _tunnelDepthInbound tunnel depth, -1 for the default._tunnelQuantity
private int _tunnelQuantityInbound tunnel count, -1 for the default._tunnelVariance
private int _tunnelVarianceInbound tunnel variance, -4 for the default._tunnelBackupQuantity
private int _tunnelBackupQuantityBackup inbound tunnels, -1 for the default._tunnelDepthOut
private int _tunnelDepthOutOutbound tunnel depth, -1 for the default._tunnelQuantityOut
private int _tunnelQuantityOutOutbound tunnel count, -1 for the default._tunnelVarianceOut
private int _tunnelVarianceOutOutbound tunnel variance, -4 for the default._tunnelBackupQuantityOut
private int _tunnelBackupQuantityOutBackup outbound tunnels, -1 for the default._connectDelay
private boolean _connectDelayWhether the tunnel starts with a delay._customOptions
Extra I2CP options typed by the user._proxyList
Proxy list for the browsing proxy._port
private int _portLocal port the tunnel listens on._reachableBy
Restriction on who may connect to the tunnel._targetDestination
Destination of the peer tunnel, for client tunnels._targetHost
Host the client tunnel connects to._targetPort
private int _targetPortPort the client tunnel connects to._spoofedHost
Host name the server tunnel claims._privKeyFile
File holding the tunnel's private keys._profile
Advanced profile name for the tunnel._startOnLoad
private boolean _startOnLoadWhether the tunnel starts when the router boots._startupDelayMin
private int _startupDelayMinMinimum startup delay in seconds for server tunnels @since 0.9.68+._startupDelayMax
private int _startupDelayMaxMaximum startup delay in seconds for server tunnels @since 0.9.68+._shutdownDelayMin
private int _shutdownDelayMinMinimum shutdown delay in seconds for server tunnels @since 0.9.68+._shutdownDelayMax
private int _shutdownDelayMaxMaximum shutdown delay in seconds for server tunnels @since 0.9.68+._booleanOptions
_otherOptions
_newProxyUser
User name for the proxy's basic auth._newProxyPW
Password for the proxy's basic auth._dest
The tunnel's destination, for server tunnels._filterDefinition
Access filter definition for the tunnel._encryptMode
private int _encryptModeEncryption level requested for the tunnel._clientNames
Client authorization names, base64._clientKeys
Client authorization keys, base64._clientRevocations
_newClientName
Name for a newly added client entry._newClientKey
Key for a newly added client entry._addClientAuth
private boolean _addClientAuthWhether a new client entry was submitted.PROP_ENABLE_ACCESS_LIST
Enables the access list as a whitelist, servers only.- See Also:
PROP_ENABLE_BLACKLIST
Enables the access list as a blacklist, servers only.- See Also:
PROP_MAX_CONNS_MIN
Streaming connection limit properties, moved from IndexBean.- See Also:
PROP_MAX_CONNS_HOUR
Hourly connection limit.- See Also:
PROP_MAX_CONNS_DAY
PROP_MAX_TOTAL_CONNS_MIN
Minute total connection limit, across all peers.- See Also:
PROP_MAX_TOTAL_CONNS_HOUR
Hourly total connection limit, across all peers.- See Also:
PROP_MAX_TOTAL_CONNS_DAY
Daily total connection limit, across all peers.- See Also:
PROP_MAX_STREAMS
_noShowOpts
Options hidden from the tunnel config form._booleanClientOpts
On/off options shown for client tunnels._booleanProxyOpts
On/off options shown for proxy tunnels._booleanServerOpts
On/off options shown for server tunnels._otherClientOpts
Valued options shown for client tunnels._otherServerOpts
Valued options shown for server tunnels._httpServerOpts
Options specific to the http server tunnel._otherProxyOpts
Do NOT add these to noShoOpts, we must leave them in for HTTPClient, Connect, and SOCKS so they will get migrated to MD5 / SHA256 digest authentication._noShowSet
_nonProxyNoShowSet
Constructor Details
TunnelConfig
public TunnelConfig()Creates an empty config, using the global context.
Method Details
setType
What type of tunnel (httpclient, ircclient, client, or server). This is required when adding a new tunnel.- Parameters:
type- the internal tunnel type
getType
The type of tunnel.- Returns:
- the internal tunnel type, one of the values set by
setType(String)
setName
Short name of the tunnel.- Parameters:
name- name shown in the tunnel list
setDescription
One line description.- Parameters:
description- free text, '#' is replaced by a space
setClientHost
I2CP host the router is on, ignored when in router context.- Parameters:
host- hostname of the I2CP router, ignored in router context
setClientPort
I2CP port the router is on, ignored when in router context.- Parameters:
port- I2CP port, ignored in router context
setTunnelDepth
public void setTunnelDepth(int tunnelDepth) How many hops to use for inbound tunnels In or both in/out.- Parameters:
tunnelDepth- hops per tunnel, negative for the default
setTunnelQuantity
public void setTunnelQuantity(int tunnelQuantity) How many parallel inbound tunnels to use In or both in/out.- Parameters:
tunnelQuantity- tunnels to maintain, negative for the default
setTunnelVariance
public void setTunnelVariance(int tunnelVariance) How much randomisation to apply to the depth of tunnels In or both in/out.- Parameters:
tunnelVariance- depth spread, -2 or higher is meaningful
setTunnelBackupQuantity
public void setTunnelBackupQuantity(int tunnelBackupQuantity) How many tunnels to hold in reserve to guard against failures In or both in/out.- Parameters:
tunnelBackupQuantity- spare tunnels, negative for the default
setTunnelDepthOut
public void setTunnelDepthOut(int tunnelDepth) How many hops to use for outbound tunnels.- Parameters:
tunnelDepth- hops per tunnel, negative copies the inbound depth
setTunnelQuantityOut
public void setTunnelQuantityOut(int tunnelQuantity) How many parallel outbound tunnels to use.- Parameters:
tunnelQuantity- tunnels to maintain, negative copies the inbound quantity
setTunnelVarianceOut
public void setTunnelVarianceOut(int tunnelVariance) How much randomisation to apply to the depth of outbound tunnels.- Parameters:
tunnelVariance- depth spread, below -2 copies the inbound variance
setTunnelBackupQuantityOut
public void setTunnelBackupQuantityOut(int tunnelBackupQuantity) How many tunnels to hold in reserve to guard against failures.- Parameters:
tunnelBackupQuantity- spare tunnels, negative copies the inbound count
setCustomOptions
What I2P session overrides should be used.- Parameters:
customOptions- space-separated key=value overrides, all tunnels
setProxyList
What HTTP outproxies should be used (httpclient specific).- Parameters:
proxyList- comma-separated outproxies, highest priority first
setPort
public void setPort(int port) What port should this client/httpclient/ircclient listen on.- Parameters:
port- local listen port, negative to leave unset
setReachableBy
What interface should this client/httpclient/ircclient listen on.- Parameters:
reachableBy- interface address, or "" for all interfaces
setTargetDestination
What peer does this client tunnel point at.- Parameters:
dest- Base64 or Base32 destination
setTargetHost
What host does this server tunnel point at.- Parameters:
host- target hostname, IPv4 or IPv6 address
setTargetPort
public void setTargetPort(int port) What port does this server tunnel point at.- Parameters:
port- target port, negative to leave unset
setSpoofedHost
What host does this http server tunnel spoof.- Parameters:
host- Host header sent to the web browser
setPrivKeyFile
Set the private key filename for this server tunnel. Absolute paths and paths containing ".." are rejected to prevent writes outside the config directory.- Parameters:
file- the private key filename, or null to clear
getPrivKeyFile
setAltPrivKeyFile
What filename is this server tunnel's alternate private keys stored in.- Parameters:
file- key file path used only if the primary one is unusable
setStartOnLoad
public void setStartOnLoad(boolean val) If called with any value, we want this tunnel to start whenever it is loaded (aka right now and whenever the router is started up).- Parameters:
val- true to start the tunnel on load
setStartupDelayMin
public void setStartupDelayMin(int val) The minimum startup delay in seconds for server tunnels.- Parameters:
val- the minimum startup delay in seconds for server tunnels
getStartupDelayMin
public int getStartupDelayMin()Returns the configured minimum startup delay.- Returns:
- the delay, in seconds
setStartupDelayMax
public void setStartupDelayMax(int val) The maximum startup delay in seconds for server tunnels.- Parameters:
val- the maximum startup delay in seconds for server tunnels
getStartupDelayMax
public int getStartupDelayMax()Returns the configured maximum startup delay.- Returns:
- the delay, in seconds
setShutdownDelayMin
public void setShutdownDelayMin(int val) The minimum shutdown delay in seconds for server tunnels.- Parameters:
val- the minimum shutdown delay in seconds for server tunnels
getShutdownDelayMin
public int getShutdownDelayMin()Returns the configured minimum shutdown delay.- Returns:
- the delay, in seconds
setShutdownDelayMax
public void setShutdownDelayMax(int val) The maximum shutdown delay in seconds for server tunnels.- Parameters:
val- the maximum shutdown delay in seconds for server tunnels
getShutdownDelayMax
public int getShutdownDelayMax()Returns the configured maximum shutdown delay.- Returns:
- the delay, in seconds
setConnectDelay
public void setConnectDelay(boolean val) Delay the connection to the target until the first client connects.- Parameters:
val- true to delay the connection to the target until the first client connects
setProfile
Streaming profile, only "interactive" has an effect.- Parameters:
profile- profile name, anything but "interactive" clears it
setReduce
public void setReduce(boolean val) Reduce the number of connections when idle.- Parameters:
val- true to reduce while idle, false to leave the setting unset
setClose
public void setClose(boolean val) Close connections when idle.- Parameters:
val- true to close while idle, false to leave the setting unset
setEncrypt
public void setEncrypt(boolean val) Encrypt the lease set.- Parameters:
val- true to encrypt, false to leave the setting unset
setEncryptMode
public void setEncryptMode(int mode) Set the lease set encryption mode.- Parameters:
mode- 0 for none, 1 for LS1, 2 for blinded, 3-9 blinded with a secret or keys
setBlindedPassword
Set the secret required to decrypt hidden encrypted LeaseSets.- Parameters:
s- password shared with clients, blank to clear
addClientNames
Multiple entries in form.- Parameters:
s- display names, paired with the client keys
addClientKeys
Multiple entries in form Handles either order addClientName/addClientKey.- Parameters:
s- Base64 32 byte keys, paired with the client names
revokeClients
Multiple entries in form.- Parameters:
s- indexes of the client entries to revoke
newClientName
Handles either order newClientName/newClientKey.- Parameters:
s- display name for the extra client, blank to auto-name it
newClientKey
Handles either order newClientName/newClientKey.- Parameters:
s- Base64 32 byte key for the extra client, blank to generate one
setAddClient
public void setAddClient(boolean val) Generate an extra per-client key, as for encrypt modes 6-9.- Parameters:
val- true to add another client key
setDCC
public void setDCC(boolean val) Allow DCC in IRC clients.- Parameters:
val- true to permit DCC, false to leave the setting unset
setUseSSL
public void setUseSSL(boolean val) Use SSL on the server port.- Parameters:
val- true to terminate TLS, false to leave the setting unset
setRejectInproxy
public void setRejectInproxy(boolean val) Reject requests from inproxies.- Parameters:
val- true to refuse forwarding headers, false to leave unset
setRejectReferer
public void setRejectReferer(boolean val) Reject requests carrying a Referer header.- Parameters:
val- true to refuse Referer requests, false to leave unset
setRejectUserAgents
public void setRejectUserAgents(boolean val) Reject requests whose User-Agent matches the blocklist.- Parameters:
val- true to apply the blocklist, false to leave unset
setUserAgents
Set the User-Agent blocklist.- Parameters:
val- comma-separated substrings to refuse; "none" blocks a blank header
setUniqueLocal
public void setUniqueLocal(boolean val) Assign unique local hostnames for destination lookup.- Parameters:
val- true to assign unique names, false to leave unset
setAccessMode
public void setAccessMode(int mode) Controls how other tunnels are checked for access.The list used for whitelisting/blacklisting can be set with
setAccessList(String).- Parameters:
mode- 0 for no control, 1 for whitelist, 2 for blacklist
setFilterDefinition
Set the filter definition.- Parameters:
filterDefinition- filter definition string, servers only
setDelayOpen
public void setDelayOpen(boolean val) Delay opening to the target until the first client connects.- Parameters:
val- true to delay the connect, false to leave the setting unset
setNewDest
public void setNewDest(int mode) Controls how ephemeral the I2P Destination of a client tunnel is.If
setClose(boolean)is set to false then mode 1 == mode 0.- Parameters:
mode- 0 for new dest on restart, 1 for new dest on resume from idle, 2 for persistent key
setReduceTime
public void setReduceTime(int val) Idle time in minutes before reducing connections.- Parameters:
val- minutes of idleness before reducing
setReduceCount
public void setReduceCount(int val) Number of connections to reduce to when idle.- Parameters:
val- connections left open while idle
setEncryptKey
Key for encrypting the lease set.- Parameters:
val- Base64 lease set encryption key, servers only
setAccessList
Comma-separated list of destinations to whitelist or blacklist.- Parameters:
val- destinations, read as allow or deny per the access mode
setJumpList
Comma-separated list of HTTP outproxy jump servers.- Parameters:
val- jump servers for multi-hop outproxying
setCloseTime
public void setCloseTime(int val) Idle time in minutes before closing connections.- Parameters:
val- minutes of idleness before closing
setAllowUserAgent
public void setAllowUserAgent(boolean val) Allow the User-Agent header to pass through the HTTP client.- Parameters:
val- true to forward the header, false to leave the setting unset
setAllowReferer
public void setAllowReferer(boolean val) Allow the Referer header to pass through the HTTP client.- Parameters:
val- true to forward the header, false to leave the setting unset
setAllowAccept
public void setAllowAccept(boolean val) Allow the Accept header to pass through the HTTP client.- Parameters:
val- true to forward the header, false to leave the setting unset
setAllowInternalSSL
public void setAllowInternalSSL(boolean val) Allow SSL connections through the HTTP client.- Parameters:
val- true to forward SSL requests, false to leave the setting unset
setMultihome
public void setMultihome(boolean val) Bundle reply info for multihoming.- Parameters:
val- true to bundle reply info, false to leave the setting unset
setProxyAuth
Sets whether authentication should be used for client proxy tunnels. Supported authentication types: "basic", "digest".- Parameters:
authType- the authentication type, or "false" for no authentication
setProxyUsername
Username for client proxy authentication.- Parameters:
s- username presented to the outproxy
setProxyPassword
Password for client proxy authentication.- Parameters:
s- password presented to the outproxy
setOutproxyAuth
public void setOutproxyAuth(boolean val) Sets whether authentication is required for any of the configured outproxies.- Parameters:
val- true if authentication is required, false otherwise
setOutproxyUsername
Username for outproxy authentication.- Parameters:
s- username presented to each outproxy
setOutproxyPassword
Password for outproxy authentication.- Parameters:
s- password presented to each outproxy
setSslProxies
Comma-separated list of SSL-capable outproxies.- Parameters:
s- outproxies reachable over SSL, for 3-hop tunnels
setUseOutproxyPlugin
public void setUseOutproxyPlugin(boolean val) Use the outproxy plugin for HTTP requests.- Parameters:
val- true to use the plugin, false to leave the setting unset
setOutproxyType
Set the type of the outproxy.- Parameters:
s- "connect" or "socks"
setLimitMinute
public void setLimitMinute(int val) Max connections per minute.- Parameters:
val- connections allowed per minute, 0 for unlimited
setLimitHour
public void setLimitHour(int val) Max connections per hour.- Parameters:
val- connections allowed per hour, 0 for unlimited
setLimitDay
public void setLimitDay(int val) Max connections per day.- Parameters:
val- connections allowed per day, 0 for unlimited
setTotalMinute
public void setTotalMinute(int val) Max total connections per minute.- Parameters:
val- connections allowed for all peers per minute, 0 for unlimited
setTotalHour
public void setTotalHour(int val) Max total connections per hour.- Parameters:
val- connections allowed for all peers per hour, 0 for unlimited
setTotalDay
public void setTotalDay(int val) Max total connections per day.- Parameters:
val- connections allowed for all peers per day, 0 for unlimited
setMaxStreams
public void setMaxStreams(int val) Max concurrent streams.- Parameters:
val- streams allowed concurrently, 0 for unlimited
setPostMax
public void setPostMax(int val) POST limits.- Parameters:
val- POST or PUT requests allowed per peer per check window
setPostTotalMax
public void setPostTotalMax(int val) Max total POST requests in the check window.- Parameters:
val- requests allowed for all peers, 0 for unlimited
setPostCheckTime
public void setPostCheckTime(int val) POST check window in minutes.- Parameters:
val- minutes per window, converted to seconds on the way out
setPostBanTime
public void setPostBanTime(int val) POST ban duration in minutes.- Parameters:
val- minutes to ban a peer for a per-peer overrun
setPostTotalBanTime
public void setPostTotalBanTime(int val) Total POST ban duration in minutes.- Parameters:
val- minutes to ban everyone for a window overrun
setSigType
Signature type for the destination.- Parameters:
val- SigType code, or the default if null
setEncType
Adds to existing, comma separated.- Parameters:
val- encryption type to append to the lease set encryption list
setInboundRandomKey
Random key for inbound tunnels.- Parameters:
s- Base64 persistent key, servers and persistent clients
setOutboundRandomKey
Random key for outbound tunnels.- Parameters:
s- Base64 persistent key, servers and persistent clients
setLeaseSetSigningPrivateKey
Private key used to sign the lease set.- Parameters:
s- SigType prefixed Base64 signing key, LS1 only
setLeaseSetPrivateKey
Private key used to encrypt the lease set.- Parameters:
s- EncType prefixed Base64 encryption key, servers only
setDestination
This is easier than requiring TunnelConfig to talk to TunnelControllerGroup and TunnelController.- Parameters:
dest- the current Destination for this tunnel.
getConfig
Based on all provided data, create a set of configuration parameters suitable for use in a TunnelController. This will replace (not add to) any existing parameters, so this should return a comprehensive mapping.- Returns:
- a new
Propertiesholding the settings for a TunnelController, replacing rather than merging any existing ones
setClientServerConfig
Set the interface or target host and the generic client or server options, including the encryption mode for servers.- Parameters:
config- the config to fill
setProxyOptions
Set the outproxy list and migrate or add proxy authentication digests for HTTP, CONNECT, and SOCKS tunnels.- Parameters:
config- the config to fill
setDestinationConfig
Set the destination, spoofed host, bidirectional server interface, and IRC DCC options.- Parameters:
config- the config to fill
setPersistentKeysConfig
Add persistent random keys and lease set signing and encryption keys for non-client tunnels and clients with persistent keys.- Parameters:
config- the config to fill
processEncryptMode
Servers only.- Parameters:
config- the tunnel config properties whose lease set options are set or cleared to match the selected encryption mode
setPerClientKeys
Add the per-client PSK or DH keys for encrypt modes 6-9, generating new keys as needed.- Parameters:
config- the config to fill
addLeaseSetPrivKey
Servers only. Also sets/clearsi2cp.leaseSetType.- Parameters:
config- the tunnel config properties to store the private key inisBlinded- true for a blinded lease set, which also stores the key in i2cp.leaseSetPrivKey and sets lease set type 5
updateConfigGeneric
Writes the shared tunnel settings into the config.- Parameters:
config- the tunnel's properties
updateTunnelQuantities
Update tunnel quantities for the provided config from this TunnelConfig.- Parameters:
config- the properties to write into; a quantity is only set when it has been given a non-negative value
parseCustomOptions
Parse the args submitted in the custom options field.Modified from
EepGet.parseAuthArgs(String)Spaces or tabs separate args. Args may be single- or double-quoted if they contain spaces or tabs. There is no provision for escaping quotes. A quoted string may not contain a quote of any kind. Double quotes around values are stripped. No quotes allowed for keys. Keys without values, e.g. key= or key will be returned with "" for the value.- Parameters:
args- non-null- Returns:
- the parsed key-value pairs, empty if none; a key with no value maps to the empty string