java.lang.Object
net.i2p.i2ptunnel.web.IndexBean
- Direct Known Subclasses:
EditBean
Backend bean for I2P tunnel management web interface.
Simple accessor for exposing tunnel info, but also an ugly form handler.
Warning - This class is not part of the i2ptunnel API, it has been moved from the jar to the war. Usage by classes outside of i2ptunnel.war is deprecated.
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final I2PAppContextApp context, for properties, randomness and key generation.protected final TunnelControllerGroupThe configured tunnels, null if the group is not initialized.protected final GeneralHelperReads tunnel properties, shared with subclasses.protected final LogLog for this bean.static final intTunnel status: not running.static final intTunnel status: running.static final intTunnel status: standby.static final intTunnel status: starting.Constructor Summary
ConstructorsConstructorDescriptionCreate the IndexBean, initializing the tunnel controller group and helper.Method Summary
Modifier and TypeMethodDescriptionprotected StringTranslate a string.protected StringEncrypt a property using an in-memory key, for interaction with the UI only, using ChaCha20.getAltDestHashBase32(int tunnel) Works even if tunnel is not running.protected DestinationgetAltDestination(int tunnel) Works even if tunnel is not running.getAltDestinationBase64(int tunnel) Works even if tunnel is not running.getClientDestination(int tunnel) The destination Base64 for the specified client tunnel.getClientInterface(int tunnel) The interface the specified client tunnel is configured to listen on.getClientPort(int tunnel) No validation.getClientPort2(int tunnel) Returns error message if blank or invalid.protected TunnelControllergetController(int tunnel) The controller for the given tunnel index.getControllerNumbers(boolean isClient) Return tunnel numbers of clients or servers only, sorted by tunnel name.getDestHashBase32(int tunnel) Works even if tunnel is not running.protected DestinationgetDestination(int tunnel) Works even if tunnel is not running.getDestinationBase64(int tunnel) Works even if tunnel is not running.getEncryptedBase32(int tunnel) Works even if tunnel is not running.getInternalType(int tunnel) The internal type string for the specified tunnel.booleangetIsOfflineKeys(int tunnel) Works even if tunnel is not running.booleangetIsUsingOutproxyPlugin(int tunnel) For index.jsp.intThe last stored message ID.Executes any action requested (start/stop/etc) and dump out the messages.static StringGet the next nonce from the queue.static StringgetNextNonce(HttpSession session) Session-bound nonce generation - replaces static nonce when session available.intgetRemainingStartupDelay(int tunnel) The remaining startup delay for the specified tunnel.getServerTarget(int tunnel) Get the server target.getSharedClient(int tunnel) Get the shared client for a tunnel.getSpoofedHost(int tunnel) Get the spoofed host for a tunnel.getTheme()Get the theme path.Get the theme name.intGet the number of tunnels.getTunnelDescription(int tunnel) The description for the specified tunnel, HTML-escaped.getTunnelName(int tunnel) Get the tunnel name.intgetTunnelStatus(int tunnel) The current status of the specified tunnel.getTunnelType(int tunnel) Get the tunnel type.(package private) StringgetType()The tunnel type.getTypeName(String internalType) Get the display name for an internal type.static booleanWhether we know this nonce.static booleanhaveNonce(String nonce, HttpSession session) Session-bound nonce validation.booleanisClient(int tunnelNum) 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 booleanIs 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.booleanCheck if the tunnel group is initialized.booleanisRejectInproxy(int tunnel) Are requests carrying inproxy forwarding headers rejected?booleanisRejectReferer(int tunnel) Are requests carrying a Referer header rejected?booleanisRejectUserAgents(int tunnel) Are blacklisted User-Agents rejected?booleanisServer(int tunnel) Is this a server tunnel?booleanisServerTargetLinkValid(int tunnel) Call this to see if it is ok to linkifygetServerTarget(int).booleanisSharedClient(int tunnel) Check if the tunnel is a shared client.booleanisSSLEnabled(int tunnel) Is SSL enabled for the server tunnel?booleanisValidIRCServer(int tunnel) Is this an IRC server? Call to establish if we should provide irc:// link on index page.protected Stringtranslate (ngettext).voidsetAccessList(String val) Comma-separated list of destinations to whitelist or blacklist.voidsetAccessMode(String val) Set the access mode, 0 for none, 1 for whitelist, 2 for blacklist.voidSet the action to process.voidsetAddClient(String val) Generate an extra per-client key, as for encrypt modes 6-9.voidsetAllowAccept(String val) Allow the Accept header to pass through the HTTP client.voidAllow SSL connections through the HTTP client.voidsetAllowReferer(String val) Allow the Referer header to pass through the HTTP client.voidsetAllowUserAgent(String 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 certificate type, from the form selection.voidsetClientHost(String host) I2CP host the router is on, ignored when in router context.voidsetclientKey(String[] s) Set client keys for access control (multiple entries in form).voidsetClientport(String port) I2CP port the router is on, ignored when in router context.voidClose connections when idle.voidsetCloseTime(String val) Idle time in minutes before closing connections.voidsetConnectDelay(String val) Delay the connection to the target until the first client connects.voidAllow DCC in IRC clients.voidsetDelayOpen(String val) Delay opening to the target until the first client connects.voidsetEncrypt(String val) Encrypt the lease set.voidsetEncryptKey(String val) Key for encrypting the lease set.voidsetEncryptMode(String val) Set the LeaseSet encryption mode.voidsetEncType(String s) Adds to existing, comma separated.voidSet the filter definition.voidsetJumpList(String val) Comma-separated list of HTTP outproxy jump servers.voidRandom keys, hidden in forms.voidRandom outbound key, hidden in forms.voidLease set signing private key, hidden in forms.voidLease set private key, hidden in forms.voidMaximum total number of connections per day.voidMaximum total number of connections per hour.voidMaximum total number of connections per minute.voidMaximum number of concurrent streams.voidSet the message ID for clearing messages.voidsetMultihome(String val) Bundle reply info for multihoming.voidAdd a key for per-client LeaseSet encryption.voidsetNewDest(String val) Control how ephemeral the destination is.voidSet the blinded password for hidden encrypted LeaseSets.voidSet client names for access control (multiple entries in form).voidsetNofilter_customOptions(String customOptions) What I2P session overrides should be used.voidsetNofilter_description(String description) One line host description.voidsetNofilter_name(String name) Short name of the tunnel.voidAdd a client for per-client LeaseSet encryption.voidPassword for outproxy authentication.voidPassword for client proxy authentication.voidSet the current nonce.voidRequire authentication for the outproxies.voidSet the type of the outproxy.voidUsername for outproxy authentication.voidWhat port should this client/httpclient/ircclient listen on.voidHow long to ban a client that exceeds the POST limits, in minutes.voidHow often the total POST limit is checked, in minutes.voidsetPostMax(String s) Maximum number of POST or PUT requests per check window, per peer.voidHow long to ban a client that exceeds the total POST limit, in minutes.voidMaximum total number of POST or PUT requests in the check interval.voidsetPrivKeyFile(String file) What filename is this server tunnel's private keys stored in.voidsetProfile(String profile) Set the streaming profile.voidSet the proxy authentication type.voidsetProxyList(String proxyList) What HTTP outproxies should be used (httpclient specific).voidUsername for client proxy authentication.voidsetReachableBy(String reachableBy) What interface should this client/httpclient/ircclient listen on.voidReduce the number of connections when idle.voidsetReduceCount(String val) Number of connections to reduce to when idle.voidsetReduceTime(String val) Idle time in minutes before reducing connections.voidsetRejectInproxy(String val) Reject requests carrying inproxy forwarding headers.voidsetRejectReferer(String val) Reject requests carrying a Referer header.voidReject requests whose User-Agent matches the blocklist.voidsetRemoveConfirm(String val) If called with any value (and the form submitted with action=Remove), we really do want to stop and remove the tunnel.voidsetRevokeClient(String[] s) Revoke access for specified clients (multiple entries in form, values are integers).voidsetSession(HttpSession session) For session-bound nonce generation and validation.voidsetShared(boolean val) Share the private key with other client tunnels.voidShare the private key with other client tunnels.voidThe maximum shutdown delay in seconds for server tunnels.voidThe minimum shutdown delay in seconds for server tunnels.voidSet the certificate signer.voidsetSigType(String val) Set the destination signature type, and rewrite the certificate to match.voidsetSpoofedHost(String host) What host does this http server tunnel spoof.voidComma-separated list of SSL-capable outproxies.voidsetStartOnLoad(String 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(String val) The maximum startup delay in seconds for server tunnels.voidsetStartupDelayMin(String 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(String port) What port does this server tunnel point at.voidMaximum total number of connections per day, enforced by the total limit.voidMaximum total number of connections per hour, enforced by the total limit.voidMaximum total number of connections per minute, enforced by the total limit.voidSet the tunnel number.voidsetTunnelBackupQuantity(String tunnelBackupQuantity) How many tunnels to hold in reserve to guard against failures In or both in/out.voidsetTunnelBackupQuantityOut(String tunnelBackupQuantity) How many outbound tunnels to hold in reserve to guard against failures.voidsetTunnelDepth(String tunnelDepth) How many hops to use for inbound tunnels In or both in/out.voidsetTunnelDepthOut(String tunnelDepth) How many hops to use for outbound tunnels.voidsetTunnelQuantity(String tunnelQuantity) How many parallel inbound tunnels to use In or both in/out.voidsetTunnelQuantityOut(String tunnelQuantity) How many parallel outbound tunnels to use.voidsetTunnelVariance(String tunnelVariance) How much randomisation to apply to the depth of tunnels In or both in/out.voidsetTunnelVarianceOut(String tunnelVariance) How much randomisation to apply to the depth of outbound tunnels.voidWhat type of tunnel (httpclient, ircclient, client, or server).voidsetUniqueLocal(String val) Assign unique local hostnames for destination lookup.voidUse the outproxy plugin for HTTP requests.voidsetUserAgents(String agents) Set the User-Agent blocklist.voidUse SSL on the server port.voidstoreMethod(String method) Store request method for P-R-G pattern.booleanCheck if the Sora font is enabled.
Field Details
_context
App context, for properties, randomness and key generation._log
Log for this bean._group
The configured tunnels, null if the group is not initialized._helper
Reads tunnel properties, shared with subclasses.RUNNING
STARTING
NOT_RUNNING
STANDBY
Constructor Details
IndexBean
public IndexBean()Create the IndexBean, initializing the tunnel controller group and helper. Nonces are initialized for CSRF protection.
Method Details
setSession
For session-bound nonce generation and validation.- Parameters:
session- the HTTP session
storeMethod
Store request method for P-R-G pattern.- Parameters:
method- the request method
isInitialized
public boolean isInitialized()Check if the tunnel group is initialized.- Returns:
- true if initialized
getNextNonce
setNonce
Set the current nonce.- Parameters:
nonce- the nonce to require of subsequent submissions; ignored if null or blank
haveNonce
Whether we know this nonce.- Parameters:
nonce- the nonce to check- Returns:
- true if the nonce is known
getNextNonce
Session-bound nonce generation - replaces static nonce when session available.- Parameters:
session- returns static nonce if null- Returns:
- a new nonce for each call
haveNonce
Session-bound nonce validation.- Parameters:
nonce- returns false if nullsession- returns static nonce check if null- Returns:
- true if valid
setAction
setTunnel
Set the tunnel number.- Parameters:
tunnel- the tunnel number to select, parsed as an integer; ignored if null or blank
setMsgid
Set the message ID for clearing messages.- Parameters:
id- the message ID
getMessages
Executes any action requested (start/stop/etc) and dump out the messages. Only call this ONCE! Or you will get duplicate tunnels on save.- Returns:
- HTML escaped or "" if empty
getLastMessageID
public int getLastMessageID()The last stored message ID.- Returns:
- the last message ID
getTheme
getThemeName
useSoraFont
public boolean useSoraFont()Check if the Sora font is enabled.- Returns:
- true if Sora font is enabled
getTunnelCount
public int getTunnelCount()Get the number of tunnels.- Returns:
- the tunnel count
getControllerNumbers
isClient
public boolean isClient(int tunnelNum) 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. Note that a streamr server is a UI and I2P server but a client on the localhost side.- Parameters:
tunnelNum- the tunnel number- Returns:
- true if it is a client
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. Note that a streamr server is a UI and I2P server but a client on the localhost side.- Parameters:
type- the tunnel type- Returns:
- true if it is a client
getTunnelName
Get the tunnel name.- Parameters:
tunnel- index of the tunnel in the configured list, or -1 for a new tunnel- Returns:
- the name as configured, never null
getClientPort
No validation.- Parameters:
tunnel- index of the tunnel in the configured list, or -1 for a new tunnel- Returns:
- the client port
getClientPort2
Returns error message if blank or invalid.- Parameters:
tunnel- index of the tunnel in the configured list, or -1 for a new tunnel- Returns:
- the client port or error message
getTunnelType
Get the tunnel type.- Parameters:
tunnel- index of the tunnel in the configured list, or -1 for a new tunnel- Returns:
- the type of the running tunnel, or the config value if not running
getTypeName
getInternalType
The internal type string for the specified tunnel.- Parameters:
tunnel- index of the tunnel in the configured list, or -1 for a new tunnel- Returns:
- the internal type
getClientInterface
The interface the specified client tunnel is configured to listen on.- Parameters:
tunnel- index of the tunnel in the configured list, or -1 for a new tunnel- Returns:
- the client interface
getTunnelStatus
public int getTunnelStatus(int tunnel) The current status of the specified tunnel.- Parameters:
tunnel- index of the tunnel in the configured list, or -1 for a new tunnel- Returns:
- the tunnel status
getRemainingStartupDelay
public int getRemainingStartupDelay(int tunnel) The remaining startup delay for the specified tunnel.- Parameters:
tunnel- index of the tunnel in the configured list, or -1 for a new tunnel- Returns:
- the remaining startup delay
getTunnelDescription
The description for the specified tunnel, HTML-escaped.- Parameters:
tunnel- index of the tunnel in the configured list, or -1 for a new tunnel- Returns:
- the tunnel description
getClientDestination
The destination Base64 for the specified client tunnel.- Parameters:
tunnel- index of the tunnel in the configured list, or -1 for a new tunnel- Returns:
- the client destination
isServerTargetLinkValid
public boolean isServerTargetLinkValid(int tunnel) Call this to see if it is ok to linkifygetServerTarget(int).- Parameters:
tunnel- index of the tunnel in the configured list, or -1 for a new tunnel- Returns:
- true if the server target link is valid
isValidIRCServer
public boolean isValidIRCServer(int tunnel) Is this an IRC server? Call to establish if we should provide irc:// link on index page.- Parameters:
tunnel- index of the tunnel in the configured list, or -1 for a new tunnel- Returns:
- true if it is a valid IRC server
isServer
public boolean isServer(int tunnel) Is this a server tunnel?- Parameters:
tunnel- index of the tunnel in the configured list, or -1 for a new tunnel- Returns:
- true if it is a server
getServerTarget
Get the server target.- Parameters:
tunnel- index of the tunnel in the configured list, or -1 for a new tunnel- Returns:
- valid host:port only if
isServerTargetLinkValid(int)is true
getDestination
Works even if tunnel is not running.- Parameters:
tunnel- index of the tunnel in the configured list, or -1 for a new tunnel- Returns:
- Destination or null
getDestinationBase64
Works even if tunnel is not running.- Parameters:
tunnel- index of the tunnel in the configured list, or -1 for a new tunnel- Returns:
- Base64 or ""
getDestHashBase32
Works even if tunnel is not running.- Parameters:
tunnel- index of the tunnel in the configured list, or -1 for a new tunnel- Returns:
- "{52 chars}.b32.i2p" or ""
getEncryptedBase32
Works even if tunnel is not running.- Parameters:
tunnel- index of the tunnel in the configured list, or -1 for a new tunnel- Returns:
- "{56 chars}.b32.i2p" or "" if not blinded
getAltDestination
Works even if tunnel is not running.- Parameters:
tunnel- index of the tunnel in the configured list, or -1 for a new tunnel- Returns:
- Destination or null
getAltDestinationBase64
Works even if tunnel is not running.- Parameters:
tunnel- index of the tunnel in the configured list, or -1 for a new tunnel- Returns:
- Base64 or ""
getAltDestHashBase32
Works even if tunnel is not running.- Parameters:
tunnel- index of the tunnel in the configured list, or -1 for a new tunnel- Returns:
- "{52 chars}.b32.i2p" or ""
getIsOfflineKeys
public boolean getIsOfflineKeys(int tunnel) Works even if tunnel is not running.- Parameters:
tunnel- index of the tunnel in the configured list, or -1 for a new tunnel- Returns:
- true if offline keys
getIsUsingOutproxyPlugin
public boolean getIsUsingOutproxyPlugin(int tunnel) For index.jsp.- Parameters:
tunnel- index of the tunnel in the configured list, or -1 for a new tunnel- Returns:
- true if the plugin is enabled, installed, and running
getSpoofedHost
Get the spoofed host for a tunnel.- Parameters:
tunnel- index of the tunnel in the configured list, or -1 for a new tunnel- Returns:
- the spoofed host
setType
What type of tunnel (httpclient, ircclient, client, or server). This is required when adding a new tunnel.- Parameters:
type- the tunnel type
getType
setNofilter_name
setNofilter_description
One line host description.- Parameters:
description- the tunnel description
setClientHost
I2CP host the router is on, ignored when in router context.- Parameters:
host- the client host
setClientport
I2CP port the router is on, ignored when in router context.- Parameters:
port- the client port
setTunnelDepth
How many hops to use for inbound tunnels In or both in/out.- Parameters:
tunnelDepth- the tunnel depth
setTunnelQuantity
How many parallel inbound tunnels to use In or both in/out.- Parameters:
tunnelQuantity- the tunnel quantity
setTunnelVariance
How much randomisation to apply to the depth of tunnels In or both in/out.- Parameters:
tunnelVariance- the tunnel variance
setTunnelBackupQuantity
How many tunnels to hold in reserve to guard against failures In or both in/out.- Parameters:
tunnelBackupQuantity- the backup quantity
setTunnelDepthOut
How many hops to use for outbound tunnels.- Parameters:
tunnelDepth- the outbound tunnel depth
setTunnelQuantityOut
How many parallel outbound tunnels to use.- Parameters:
tunnelQuantity- the outbound tunnel quantity
setTunnelVarianceOut
How much randomisation to apply to the depth of outbound tunnels.- Parameters:
tunnelVariance- the outbound tunnel variance
setTunnelBackupQuantityOut
How many outbound tunnels to hold in reserve to guard against failures.- Parameters:
tunnelBackupQuantity- the outbound backup quantity
setNofilter_customOptions
What I2P session overrides should be used.- Parameters:
customOptions- the custom options
setProxyList
What HTTP outproxies should be used (httpclient specific).- Parameters:
proxyList- the proxy list
setPort
What port should this client/httpclient/ircclient listen on.- Parameters:
port- the port number
setReachableBy
What interface should this client/httpclient/ircclient listen on.- Parameters:
reachableBy- the reachable interface
setTargetDestination
What peer does this client tunnel point at.- Parameters:
dest- the target destination
setTargetHost
What host does this server tunnel point at.- Parameters:
host- the target host
setTargetPort
What port does this server tunnel point at.- Parameters:
port- the target port
setSpoofedHost
What host does this http server tunnel spoof.- Parameters:
host- the spoofed host
setPrivKeyFile
What filename is this server tunnel's private keys stored in.- Parameters:
file- relative filename for the destination keys, or null to clear
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
setRemoveConfirm
If called with any value (and the form submitted with action=Remove), we really do want to stop and remove the tunnel.- Parameters:
val- any value confirms removal
setStartOnLoad
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- any value triggers startup on load
setStartupDelayMin
The minimum startup delay in seconds for server tunnels.- Parameters:
val- the minimum startup delay in seconds for server tunnels
setStartupDelayMax
The maximum startup delay in seconds for server tunnels.- Parameters:
val- the maximum startup delay in seconds for server tunnels
setShutdownDelayMin
The minimum shutdown delay in seconds for server tunnels.- Parameters:
val- the minimum shutdown delay in seconds for server tunnels
setShutdownDelayMax
The maximum shutdown delay in seconds for server tunnels.- Parameters:
val- the maximum shutdown delay in seconds for server tunnels
setConnectDelay
Delay the connection to the target until the first client connects.- Parameters:
val- any value enables connect delay
setProfile
Set the streaming profile.- Parameters:
profile- profile name; only "interactive" changes behavior
setReduce
Reduce the number of connections when idle.- Parameters:
val- any value enables reduce on idle
setClose
Close connections when idle.- Parameters:
val- any value enables close on idle
setEncrypt
Encrypt the lease set.- Parameters:
val- any value enables lease set encryption
setEncryptMode
Set the LeaseSet encryption mode.- Parameters:
val- the encryption mode value
setNofilter_blindedPassword
Set the blinded password for hidden encrypted LeaseSets.- Parameters:
s- the blinded password
setNofilter_clientName
Set client names for access control (multiple entries in form).- Parameters:
s- the client names
setclientKey
Set client keys for access control (multiple entries in form).- Parameters:
s- the client keys
setRevokeClient
Revoke access for specified clients (multiple entries in form, values are integers).- Parameters:
s- the client indices to revoke
setNofilter_newClientName
Add a client for per-client LeaseSet encryption.- Parameters:
s- display name for the new client
setNewClientKey
Add a key for per-client LeaseSet encryption.- Parameters:
s- Base64 key for the new client, blank to generate one
setAddClient
Generate an extra per-client key, as for encrypt modes 6-9.- Parameters:
val- any value requests another client key
setDCC
setUseSSL
isSSLEnabled
public boolean isSSLEnabled(int tunnel) Is SSL enabled for the server tunnel?- Parameters:
tunnel- index of the tunnel in the configured list- Returns:
- true if the server tunnel terminates TLS
setRejectInproxy
Reject requests carrying inproxy forwarding headers.- Parameters:
val- any value enables inproxy rejection
isRejectInproxy
public boolean isRejectInproxy(int tunnel) Are requests carrying inproxy forwarding headers rejected?- Parameters:
tunnel- index of the tunnel in the configured list- Returns:
- true if inproxy requests are refused
setRejectReferer
Reject requests carrying a Referer header.- Parameters:
val- any value enables Referer rejection
isRejectReferer
public boolean isRejectReferer(int tunnel) Are requests carrying a Referer header rejected?- Parameters:
tunnel- index of the tunnel in the configured list- Returns:
- true if Referer requests are refused
setRejectUserAgents
Reject requests whose User-Agent matches the blocklist.- Parameters:
val- any value enables User-Agent rejection
isRejectUserAgents
public boolean isRejectUserAgents(int tunnel) Are blacklisted User-Agents rejected?- Parameters:
tunnel- index of the tunnel in the configured list- Returns:
- true if User-Agent requests are refused
setUserAgents
Set the User-Agent blocklist.- Parameters:
agents- comma-separated substrings to refuse; "none" blocks a blank header
setUniqueLocal
Assign unique local hostnames for destination lookup.- Parameters:
val- any value enables unique local hostnames
setAccessMode
Set the access mode, 0 for none, 1 for whitelist, 2 for blacklist.- Parameters:
val- 0 for no access control, 1 for whitelist, 2 for blacklist
setFilterDefinition
Set the filter definition.- Parameters:
val- filter definition, servers only
setDelayOpen
Delay opening to the target until the first client connects.- Parameters:
val- any value enables delay open
setNewDest
Control how ephemeral the destination is.- Parameters:
val- 0 for new dest on restart, 1 on idle resume, 2 to keep the key
setReduceTime
Idle time in minutes before reducing connections.- Parameters:
val- minutes of idleness before reducing
setReduceCount
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
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
Idle time in minutes before closing connections.- Parameters:
val- minutes of idleness before closing
setAllowUserAgent
Allow the User-Agent header to pass through the HTTP client.- Parameters:
val- any value allows the User-Agent header
setAllowReferer
Allow the Referer header to pass through the HTTP client.- Parameters:
val- any value allows the Referer header
setAllowAccept
Allow the Accept header to pass through the HTTP client.- Parameters:
val- any value allows the Accept header
setAllowInternalSSL
Allow SSL connections through the HTTP client.- Parameters:
val- any value allows internal SSL connections
setMultihome
Bundle reply info for multihoming.- Parameters:
val- any value bundles reply info
setProxyAuth
Set the proxy authentication type.- Parameters:
s- any value enables proxy authentication
setProxyUsername
Username for client proxy authentication.- Parameters:
s- username offered to the outproxy
setNofilter_proxyPassword
Password for client proxy authentication.- Parameters:
s- password offered to the outproxy
setOutproxyAuth
Require authentication for the outproxies.- Parameters:
s- any value requires outproxy authentication
setOutproxyUsername
Username for outproxy authentication.- Parameters:
s- username presented to each outproxy
setNofilter_outproxyPassword
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
Use the outproxy plugin for HTTP requests.- Parameters:
val- any value enables the plugin instead of the proxy list
setOutproxyType
Set the type of the outproxy.- Parameters:
s- "connect" or "socks"
setLimitMinute
Maximum total number of connections per minute.- Parameters:
s- connections allowed per minute, 0 for unlimited
setLimitHour
Maximum total number of connections per hour.- Parameters:
s- connections allowed per hour, 0 for unlimited
setLimitDay
Maximum total number of connections per day.- Parameters:
s- connections allowed per day, 0 for unlimited
setTotalMinute
Maximum total number of connections per minute, enforced by the total limit.- Parameters:
s- connections allowed for all peers per minute, 0 for unlimited
setTotalHour
Maximum total number of connections per hour, enforced by the total limit.- Parameters:
s- connections allowed for all peers per hour, 0 for unlimited
setTotalDay
Maximum total number of connections per day, enforced by the total limit.- Parameters:
s- connections allowed for all peers per day, 0 for unlimited
setMaxStreams
Maximum number of concurrent streams.- Parameters:
s- streams allowed concurrently, 0 for unlimited
setPostMax
Maximum number of POST or PUT requests per check window, per peer.- Parameters:
s- requests allowed per peer, 0 for unlimited
setPostTotalMax
Maximum total number of POST or PUT requests in the check interval.- Parameters:
s- requests allowed for all peers, 0 for unlimited
setPostCheckTime
How often the total POST limit is checked, in minutes.- Parameters:
s- check window in minutes
setPostBanTime
How long to ban a client that exceeds the POST limits, in minutes.- Parameters:
s- ban duration in minutes for a per-peer overrun
setPostTotalBanTime
How long to ban a client that exceeds the total POST limit, in minutes.- Parameters:
s- ban duration in minutes for a window overrun
setCert
Set the certificate type, from the form selection.- Parameters:
val- Certificate.CERTIFICATE_TYPE_* value
setSigner
Set the certificate signer.- Parameters:
val- name or spoofed host of the tunnel whose destination signs
setSigType
Set the destination signature type, and rewrite the certificate to match.- Parameters:
val- SigType code; also selects a hidden or signed certificate
setEncType
Adds to existing, comma separated.- Parameters:
s- encryption type to append to the lease set encryption list
setKey1
Random keys, hidden in forms.- Parameters:
s- encrypted inbound random key
setKey2
Random outbound key, hidden in forms.- Parameters:
s- encrypted outbound random key
setKey3
Lease set signing private key, hidden in forms.- Parameters:
s- encrypted lease set signing private key
setKey4
Lease set private key, hidden in forms.- Parameters:
s- encrypted lease set private key
encrypt
Encrypt a property using an in-memory key, for interaction with the UI only, using ChaCha20. The IV is random and prepended to the ciphertext (12 bytes); the previous IV = SHA256(k) reused the keystream for the same property name under the same cached form key.These are transient keys by design, but are persisted to hide restarts. They are hidden inputs in the edit form. Storage in config files is not encrypted.
- Parameters:
tunnel- index selecting the in-memory form keyk- non-nullv- may be empty or null- Returns:
- Base64, or empty, or null
getController
The controller for the given tunnel index.- Parameters:
tunnel- index of the tunnel in the configured list- Returns:
- the controller, or null if there is none
_t
ngettext