public interface ProxyManagerBootstrap<T extends ProxyManagerBootstrap>
| 限定符和类型 | 方法和说明 |
|---|---|
void |
abort()
Build and non graceful stop the server.
|
T |
plusActivityTracker(ActivityTracker activityTracker)
Add an
ActivityTracker for tracking activity in this proxy. |
ProxyManager |
start()
Build and starts the server.
|
void |
stop()
Build and graceful stop the server.
|
T |
withAddress(InetSocketAddress address)
Listen for incoming connections on the given address.
|
T |
withAllowLocalOnly(boolean allowLocalOnly)
Specify whether or not to only allow local connections.
|
T |
withApplicationName(String applicationName) |
T |
withConnectTimeout(int connectTimeout)
Specify the timeout for connecting to the upstream server on a new connection, in milliseconds.
|
T |
withEventThreadPoolGracefulShutdownAwaitSeconds(int eventThreadPoolGracefulShutdownAwaitSeconds) |
T |
withEventThreadPoolGracefulShutdownQuietPeriodSeconds(long eventThreadPoolGracefulShutdownQuietPeriodSeconds) |
T |
withEventThreadPoolGracefulShutdownTimeoutSeconds(long eventThreadPoolGracefulShutdownTimeoutSeconds) |
T |
withGracefulShutdown(boolean gracefulShutdown) |
T |
withGracefulShutdownAwaitSeconds(int gracefulShutdownAwaitSeconds) |
T |
withIdleConnectionTimeout(int idleConnectionTimeout)
Specify the timeout after which to disconnect idle connections, in seconds.
|
T |
withName(String name)
Give the server a name (used for naming threads, useful for logging).
|
T |
withNetworkInterface(InetSocketAddress inetSocketAddress)
All outgoing-communication of the proxy-instance is goin' to be routed via the given network-interface
|
T |
withPort(int port)
Listen for incoming connections on the given port.
|
T |
withProxyAlias(String alias)
Sets the alias to use when adding Via headers to incoming and outgoing HTTP messages.
|
T |
withServerGroup(ServerGroup serverGroup) |
T |
withServerResolver(HostResolver serverResolver)
Specify a custom
HostResolver for resolving server addresses. |
T |
withSslEngineSource(SslEngineSource sslEngineSource)
Specify an
SslEngineSource to use for encrypting inbound connections. |
T |
withTcpBackLog(int tcpBackLog) |
T |
withThreadPoolConfiguration(ThreadPoolConfiguration configuration)
Set the configuration parameters for the proxy's thread pools.
|
T |
withThrottling(boolean enabledThrottle,
long readThrottleBytesPerSecond,
long writeThrottleBytesPerSecond,
long throttleCheckIntervalMills,
long maxTrafficDelaySeconds)
Specify the read and/or write bandwidth throttles for this proxy server. 0 indicates not throttling.
|
default T |
withThrottling(long readThrottleBytesPerSecond,
long writeThrottleBytesPerSecond)
Specify the read and/or write bandwidth throttles for this proxy server. 0 indicates not throttling.
|
T |
withTransparent(boolean transparent)
Specify whether or not to run this proxy as a transparent proxy.
|
T |
withTransportProtocol(TransportProtocol transportProtocol)
Specify the
TransportProtocol to use for incoming connections. |
T |
withUdpBackLog(int udpBackLog) |
ProxyManager start()
Build and starts the server.
void stop()
Build and graceful stop the server.
void abort()
Build and non graceful stop the server.
T withName(String name)
Give the server a name (used for naming threads, useful for logging).
name - nameT withTransportProtocol(TransportProtocol transportProtocol)
Specify the TransportProtocol to use for incoming connections.
Default = TCP
transportProtocol - transport protocolT withAddress(InetSocketAddress address)
Listen for incoming connections on the given address.
Default = [bound ip]:8080
address - addressT withPort(int port)
Listen for incoming connections on the given port.
Default = 8080
port - portT withSslEngineSource(SslEngineSource sslEngineSource)
Specify an SslEngineSource to use for encrypting inbound connections.
Default = null
sslEngineSource - SSL engine sourceT withProxyAlias(String alias)
alias - the pseudonym to add to Via headersT withTransparent(boolean transparent)
Specify whether or not to run this proxy as a transparent proxy.
Default = false
transparent - transparent or notT withIdleConnectionTimeout(int idleConnectionTimeout)
Specify the timeout after which to disconnect idle connections, in seconds.
Default = 70
idleConnectionTimeout - idle connection timeout in millisecondsT withConnectTimeout(int connectTimeout)
Specify the timeout for connecting to the upstream server on a new connection, in milliseconds.
Default = 40000
connectTimeout - connect timeout in millisecondsT withServerResolver(HostResolver serverResolver)
HostResolver for resolving server addresses.serverResolver - server host resolverT plusActivityTracker(ActivityTracker activityTracker)
Add an ActivityTracker for tracking activity in this proxy.
activityTracker - activity trackerdefault T withThrottling(long readThrottleBytesPerSecond, long writeThrottleBytesPerSecond)
Specify the read and/or write bandwidth throttles for this proxy server. 0 indicates not throttling.
readThrottleBytesPerSecond - read BPSwriteThrottleBytesPerSecond - write BPST withThrottling(boolean enabledThrottle, long readThrottleBytesPerSecond, long writeThrottleBytesPerSecond, long throttleCheckIntervalMills, long maxTrafficDelaySeconds)
Specify the read and/or write bandwidth throttles for this proxy server. 0 indicates not throttling.
enabledThrottle - enables throttlereadThrottleBytesPerSecond - read BPSwriteThrottleBytesPerSecond - write BPSthrottleCheckIntervalMills - check interval in millisecondsmaxTrafficDelaySeconds - throttle delay in secondsT withNetworkInterface(InetSocketAddress inetSocketAddress)
inetSocketAddress - to be used for outgoing communicationT withTcpBackLog(int tcpBackLog)
T withUdpBackLog(int udpBackLog)
T withAllowLocalOnly(boolean allowLocalOnly)
Specify whether or not to only allow local connections.
Default = true
allowLocalOnly - whether to allow local access onlyT withThreadPoolConfiguration(ThreadPoolConfiguration configuration)
configuration - thread pool configurationT withServerGroup(ServerGroup serverGroup)
T withGracefulShutdown(boolean gracefulShutdown)
T withGracefulShutdownAwaitSeconds(int gracefulShutdownAwaitSeconds)
T withEventThreadPoolGracefulShutdownQuietPeriodSeconds(long eventThreadPoolGracefulShutdownQuietPeriodSeconds)
T withEventThreadPoolGracefulShutdownTimeoutSeconds(long eventThreadPoolGracefulShutdownTimeoutSeconds)
T withEventThreadPoolGracefulShutdownAwaitSeconds(int eventThreadPoolGracefulShutdownAwaitSeconds)
Copyright © 2021 Zodiac. All rights reserved.