### Bootstrap and Start DefaultHttpProxyServer Source: https://javadoc.io/doc/org.littleshoot/littleproxy/1.1.2/org/littleshoot/proxy/impl/DefaultHttpProxyServer.html This example shows how to bootstrap and start the DefaultHttpProxyServer with a specified port. Ensure the port is available before starting. ```java DefaultHttpProxyServer server = DefaultHttpProxyServer .bootstrap() .withPort(8090) .start(); ``` -------------------------------- ### start Source: https://javadoc.io/doc/org.littleshoot/littleproxy/1.1.2/org/littleshoot/proxy/HttpProxyServerBootstrap.html Builds and starts the HTTP proxy server. ```APIDOC ## start ### Description Build and starts the server. ### Method `HttpProxyServer start()` ### Returns - **HttpProxyServer** - the newly built and started server ``` -------------------------------- ### HttpProxyServerBootstrap Start Method Source: https://javadoc.io/doc/org.littleshoot/littleproxy/1.1.2/index-all.html Method to build and start the HTTP proxy server. ```APIDOC ## start() ### Description Build and starts the server. ### Method Method signature from interface org.littleshoot.proxy.HttpProxyServerBootstrap ``` -------------------------------- ### DefaultHttpProxyServer.doStart() Source: https://javadoc.io/doc/org.littleshoot/littleproxy/1.1.2/index-all.html Starts the HTTP proxy server. ```APIDOC ## doStart() ### Description Starts the HTTP proxy server. ### Method N/A (Java Method) ### Endpoint N/A ### Parameters N/A ### Request Example N/A ### Response N/A ``` -------------------------------- ### HttpProxyServer Start Method Source: https://javadoc.io/doc/org.littleshoot/littleproxy/1.1.2/org/littleshoot/proxy/impl/DefaultHttpProxyServer.DefaultHttpProxyServerBootstrap.html Method to build and start the configured HTTP proxy server. ```APIDOC ## start ### Description Build and starts the server. ### Method `start` ### Returns `HttpProxyServer` - The started HTTP proxy server instance. ``` -------------------------------- ### HttpProxyServerBootstrap Source: https://javadoc.io/doc/org.littleshoot/littleproxy/1.1.2/index-all.html Configures and starts an `HttpProxyServer`. ```APIDOC ## Interface HttpProxyServerBootstrap ### Description Configures and starts an `HttpProxyServer`. ### Methods (No specific methods documented in the source) ``` -------------------------------- ### Start the HttpProxyServer Source: https://javadoc.io/doc/org.littleshoot/littleproxy/1.1.2/org/littleshoot/proxy/impl/DefaultHttpProxyServer.DefaultHttpProxyServerBootstrap.html Builds and starts the HTTP proxy server. This method is defined in the HttpProxyServerBootstrap interface and returns the newly built and started server. ```java public HttpProxyServer start() ``` -------------------------------- ### bootstrap Source: https://javadoc.io/doc/org.littleshoot/littleproxy/1.1.2/org/littleshoot/proxy/impl/DefaultHttpProxyServer.html Bootstrap a new DefaultHttpProxyServer starting from scratch. ```APIDOC ## bootstrap ### Description Bootstrap a new `DefaultHttpProxyServer` starting from scratch. ### Method ```java public static HttpProxyServerBootstrap bootstrap() ``` ### Returns An `HttpProxyServerBootstrap` instance. ``` -------------------------------- ### main Source: https://javadoc.io/doc/org.littleshoot/littleproxy/1.1.2/org/littleshoot/proxy/Launcher.html Starts the proxy from the command line. This is the primary entry point for launching the proxy. ```APIDOC ## main ### Description Starts the proxy from the command line. ### Method `public static void main(String... args)` ### Parameters #### Path Parameters - **args** (String...) - Required - Any command line arguments. ``` -------------------------------- ### DefaultHttpProxyServer.DefaultHttpProxyServerBootstrap Constructors Source: https://javadoc.io/doc/org.littleshoot/littleproxy/1.1.2/index-all.html Bootstrap class for configuring and starting the HTTP proxy server. ```APIDOC ## DefaultHttpProxyServerBootstrap() ### Description Creates a new DefaultHttpProxyServerBootstrap. ### Method N/A (Java Constructor) ### Endpoint N/A ### Parameters N/A ### Request Example N/A ### Response N/A ## DefaultHttpProxyServerBootstrap(ServerGroup, TransportProtocol, InetSocketAddress, SslEngineSource, boolean, ProxyAuthenticator, ChainedProxyManager, MitmManager, HttpFiltersSource, boolean, int, Collection, int, HostResolver, long, long, InetSocketAddress, String, int, int, int, boolean) ### Description Creates a new DefaultHttpProxyServerBootstrap with detailed configuration. ### Method N/A (Java Constructor) ### Endpoint N/A ### Parameters N/A ### Request Example N/A ### Response N/A ## DefaultHttpProxyServerBootstrap(Properties) ### Description Creates a new DefaultHttpProxyServerBootstrap from a Properties object. ### Method N/A (Java Constructor) ### Endpoint N/A ### Parameters N/A ### Request Example N/A ### Response N/A ``` -------------------------------- ### HttpProxyServerBootstrap Configuration Methods Source: https://javadoc.io/doc/org.littleshoot/littleproxy/1.1.2/org/littleshoot/proxy/HttpProxyServerBootstrap.html Methods for configuring various aspects of the HttpProxyServer before it is started. ```APIDOC ## HttpProxyServerBootstrap Configuration This interface provides methods to configure and start an `HttpProxyServer`. Sensible defaults are available, allowing `start()` to be called immediately. ### Methods - **`plusActivityTracker(ActivityTracker activityTracker)`**: Add an `ActivityTracker` for tracking activity in this proxy. - **`start()`**: Build and starts the server. - **`withAddress(InetSocketAddress address)`**: Listen for incoming connections on the given address. - **`withAllowLocalOnly(boolean allowLocalOnly)`**: Specify whether or not to only allow local connections. - **`withAllowRequestToOriginServer(boolean allowRequestToOriginServer)`**: When true, the proxy will accept requests that appear to be directed at an origin server (i.e. the `Host` header matches the origin server). - **`withAuthenticateSslClients(boolean authenticateSslClients)`**: Specify whether or not to authenticate inbound SSL clients (only applies if `withSslEngineSource(SslEngineSource)` has been set). - **`withChainProxyManager(ChainedProxyManager chainProxyManager)`**: Specify a `ChainedProxyManager` to use for chaining requests to another proxy. - **`withConnectTimeout(int connectTimeout)`**: Specify the timeout for connecting to the upstream server on a new connection, in milliseconds. - **`withFiltersSource(HttpFiltersSource filtersSource)`**: Specify a `HttpFiltersSource` to use for filtering requests and/or responses through this proxy. - **`withIdleConnectionTimeout(int idleConnectionTimeout)`**: Specify the timeout after which to disconnect idle connections, in seconds. - **`withListenOnAllAddresses(boolean listenOnAllAddresses)`**: Deprecated. Use `withNetworkInterface(InetSocketAddress)` to avoid listening on all local addresses. - **`withManInTheMiddle(MitmManager mitmManager)`**: Specify an `MitmManager` to use for making this proxy act as an SSL man in the middle. - **`withMaxChunkSize(int maxChunkSize)`**: Sets the maximum chunk size for HTTP requests/responses. - **`withMaxHeaderSize(int maxHeaderSize)`**: Sets the maximum header size for HTTP requests/responses. - **`withMaxInitialLineLength(int maxInitialLineLength)`**: Sets the maximum initial line length for HTTP requests/responses. - **`withName(String name)`**: Give the server a name (used for naming threads, useful for logging). - **`withNetworkInterface(InetSocketAddress inetSocketAddress)`**: All outgoing communication of the proxy instance will be routed via the given network interface. - **`withPort(int port)`**: Listen for incoming connections on the given port. - **`withProxyAlias(String alias)`**: Sets the alias to use when adding Via headers to incoming and outgoing HTTP messages. - **`withProxyAuthenticator(ProxyAuthenticator proxyAuthenticator)`**: Specify a `ProxyAuthenticator` to use for doing basic HTTP authentication of clients. - **`withServerResolver(HostResolver serverResolver)`**: Specify a custom `HostResolver` for resolving server addresses. - **`withSslEngineSource(SslEngineSource sslEngineSource)`**: Specify an `SslEngineSource` to use for encrypting inbound connections. - **`withThreadPoolConfiguration(ThreadPoolConfiguration configuration)`**: Set the configuration parameters for the proxy's thread pools. - **`withThrottling(long readThrottleBytesPerSecond, long writeThrottleBytesPerSecond)`**: Specify the read and/or write bandwidth throttles for this proxy server. - **`withTransparent(boolean transparent)`**: Specify whether or not to run this proxy as a transparent proxy. ``` -------------------------------- ### ConnectionFlow.start() Source: https://javadoc.io/doc/org.littleshoot/littleproxy/1.1.2/org/littleshoot/proxy/impl/ConnectionFlow.html Initiates the connection flow process and notifies the ClientToProxyConnection that the flow has started. ```APIDOC ## ConnectionFlow.start() ### Description Starts the connection flow. This method initiates the sequence of steps defined in the `ConnectionFlow` and notifies the `ClientToProxyConnection` that the process has begun. ### Method `void start()` ``` -------------------------------- ### Main Method for Starting Proxy Source: https://javadoc.io/doc/org.littleshoot/littleproxy/1.1.2/org/littleshoot/proxy/Launcher.html The main entry point for launching the HTTP proxy from the command line. Accepts an array of String arguments for configuration. ```java public static void main(String... args) ``` -------------------------------- ### Start Connection Flow Source: https://javadoc.io/doc/org.littleshoot/littleproxy/1.1.2/org/littleshoot/proxy/impl/ConnectionFlow.html Initiates the connection establishment process. This method signals the ClientToProxyConnection that the flow has begun. ```java void start() ``` -------------------------------- ### advance Source: https://javadoc.io/doc/org.littleshoot/littleproxy/1.1.2/org/littleshoot/proxy/impl/ConnectionFlow.html Starts the connection flow and advances through the defined steps until completion or failure. ```APIDOC ## advance ### Description Starts the connection flow, notifying the `ClientToProxyConnection` that we've started. Advances the flow. `advance()` will be called until we're either out of steps, or a step has failed. ### Method void ### Parameters None ``` -------------------------------- ### HttpProxyServerBootstrap Source: https://javadoc.io/doc/org.littleshoot/littleproxy/1.1.2/org/littleshoot/proxy/package-summary.html The HttpProxyServerBootstrap class is used to configure and start an HttpProxyServer. It provides a fluent API for setting up various proxy configurations. ```APIDOC ## HttpProxyServerBootstrap ### Description Configures and starts an `HttpProxyServer`. ### Class `HttpProxyServerBootstrap` ``` -------------------------------- ### Proxy to Server Connection Started Source: https://javadoc.io/doc/org.littleshoot/littleproxy/1.1.2/org/littleshoot/proxy/HttpFiltersAdapter.html Informs the filter that a connection to the proxy server is initiating. ```java public void proxyToServerConnectionStarted() ``` -------------------------------- ### getCurrentState Source: https://javadoc.io/doc/org.littleshoot/littleproxy/1.1.2/org/littleshoot/proxy/impl/ProxyConnection.html Gets the current state of the connection. ```APIDOC ## getCurrentState ### Description Gets the current state of the connection. ### Method protected ConnectionState ### Returns The current ConnectionState. ``` -------------------------------- ### Server Bootstrapping Source: https://javadoc.io/doc/org.littleshoot/littleproxy/1.1.2/org/littleshoot/proxy/impl/DefaultHttpProxyServer.html Methods for initializing and configuring a new HTTP proxy server instance. ```APIDOC ## Server Bootstrapping ### bootstrap() Bootstrap a new `DefaultHttpProxyServer` starting from scratch. ### bootstrapFromFile(String path) Bootstrap a new `DefaultHttpProxyServer` using defaults from the given file. ``` -------------------------------- ### getListenAddress Source: https://javadoc.io/doc/org.littleshoot/littleproxy/1.1.2/org/littleshoot/proxy/impl/DefaultHttpProxyServer.html Gets the address on which this proxy is listening. ```APIDOC ## getListenAddress ### Description Return the address on which this proxy is listening. ### Method ```java public InetSocketAddress getListenAddress() ``` ### Returns The `InetSocketAddress` the proxy is listening on. ``` -------------------------------- ### setupConnectionParameters Source: https://javadoc.io/doc/org.littleshoot/littleproxy/1.1.2/org/littleshoot/proxy/impl/ProxyToServerConnection.html Set up connection parameters based on server address and chained proxies. ```APIDOC ## setupConnectionParameters ### Description Set up connection parameters based on server address and chained proxies. ### Method private void setupConnectionParameters() throws UnknownHostException ### Throws - UnknownHostException: when unable to resolve the hostname to an IP address. ``` -------------------------------- ### getWriteThrottle Source: https://javadoc.io/doc/org.littleshoot/littleproxy/1.1.2/org/littleshoot/proxy/impl/DefaultHttpProxyServer.html Gets the current write throttle bandwidth. ```APIDOC ## getWriteThrottle ### Description Gets the current write throttle bandwidth. ### Method ```java public long getWriteThrottle() ``` ### Returns The write throttle bandwidth in bytes per second. ``` -------------------------------- ### getReadThrottle Source: https://javadoc.io/doc/org.littleshoot/littleproxy/1.1.2/org/littleshoot/proxy/impl/DefaultHttpProxyServer.html Gets the current read throttle bandwidth. ```APIDOC ## getReadThrottle ### Description Gets the current read throttle bandwidth. ### Method ```java public long getReadThrottle() ``` ### Returns The read throttle bandwidth in bytes per second. ``` -------------------------------- ### getLocalAddress Source: https://javadoc.io/doc/org.littleshoot/littleproxy/1.1.2/org/littleshoot/proxy/impl/DefaultHttpProxyServer.html Gets the local address the proxy is bound to. ```APIDOC ## getLocalAddress ### Description Gets the local address the proxy is bound to. ### Method ```java public InetSocketAddress getLocalAddress() ``` ### Returns The `InetSocketAddress` the proxy is listening on. ``` -------------------------------- ### DefaultHttpProxyServer.DefaultHttpProxyServerBootstrap Constructor Source: https://javadoc.io/doc/org.littleshoot/littleproxy/1.1.2/org/littleshoot/proxy/class-use/ProxyAuthenticator.html Initializes a new bootstrap for creating an HttpProxyServer, potentially with authentication. ```APIDOC ## DefaultHttpProxyServer.DefaultHttpProxyServerBootstrap Constructor ### Description Initializes a new bootstrap for creating an HttpProxyServer. ### Method `DefaultHttpProxyServerBootstrap` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response None ERROR HANDLING: None ``` -------------------------------- ### getServerResolver Source: https://javadoc.io/doc/org.littleshoot/littleproxy/1.1.2/org/littleshoot/proxy/impl/DefaultHttpProxyServer.html Gets the server resolver used by the proxy. ```APIDOC ## getServerResolver ### Description Gets the server resolver used by the proxy. ### Method ```java public HostResolver getServerResolver() ``` ### Returns The `HostResolver` instance. ``` -------------------------------- ### getMaxChunkSize Source: https://javadoc.io/doc/org.littleshoot/littleproxy/1.1.2/org/littleshoot/proxy/impl/DefaultHttpProxyServer.html Gets the maximum size allowed for HTTP chunks. ```APIDOC ## getMaxChunkSize ### Description Gets the maximum size allowed for HTTP chunks. ### Method ```java public int getMaxChunkSize() ``` ### Returns The maximum chunk size in bytes. ``` -------------------------------- ### initializeKeyStore Source: https://javadoc.io/doc/org.littleshoot/littleproxy/1.1.2/index-all.html Initializes the Key Store for SSL operations. ```APIDOC ## initializeKeyStore() ### Description Initialize the Key Store. ### Method (Not specified in source, likely a utility method) ### Endpoint (Not applicable for this method) ### Parameters (No parameters specified in source) ### Request Example (Not applicable for this method) ### Response (Response type not specified in source) ### Response Example (Not applicable for this method) ``` -------------------------------- ### getMaxHeaderSize Source: https://javadoc.io/doc/org.littleshoot/littleproxy/1.1.2/org/littleshoot/proxy/impl/DefaultHttpProxyServer.html Gets the maximum size allowed for HTTP headers. ```APIDOC ## getMaxHeaderSize ### Description Gets the maximum size allowed for HTTP headers. ### Method ```java public int getMaxHeaderSize() ``` ### Returns The maximum header size in bytes. ``` -------------------------------- ### DefaultHttpProxyServer.DefaultHttpProxyServerBootstrap Constructor Source: https://javadoc.io/doc/org.littleshoot/littleproxy/1.1.2/org/littleshoot/proxy/class-use/HostResolver.html Constructor for DefaultHttpProxyServer.DefaultHttpProxyServerBootstrap that accepts a HostResolver. ```APIDOC ## DefaultHttpProxyServer.DefaultHttpProxyServerBootstrap(..., HostResolver serverResolver, ...) ### Description Constructor for the bootstrap class that allows setting a custom `HostResolver`. ### Method `DefaultHttpProxyServer.DefaultHttpProxyServerBootstrap` constructor ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```java // Assuming other parameters are provided HostResolver resolver = new DefaultHostResolver(); // Or a custom implementation DefaultHttpProxyServer.DefaultHttpProxyServerBootstrap bootstrap = new DefaultHttpProxyServer.DefaultHttpProxyServerBootstrap( // ... other parameters ... resolver, // ... other parameters ... ); ``` ### Response None #### Success Response (200) None #### Response Example None ``` -------------------------------- ### getConnectTimeout Source: https://javadoc.io/doc/org.littleshoot/littleproxy/1.1.2/org/littleshoot/proxy/impl/DefaultHttpProxyServer.html Gets the maximum time to wait to connect to a server. ```APIDOC ## getConnectTimeout ### Description Returns the maximum time to wait, in milliseconds, to connect to a server. ### Method ```java public int getConnectTimeout() ``` ### Returns The connection timeout in milliseconds. ``` -------------------------------- ### DefaultHttpProxyServer.DefaultHttpProxyServerBootstrap.withSslEngineSource Source: https://javadoc.io/doc/org.littleshoot/littleproxy/1.1.2/org/littleshoot/proxy/class-use/SslEngineSource.html This method on the bootstrap class allows setting the SslEngineSource for the proxy server configuration. ```APIDOC ## DefaultHttpProxyServer.DefaultHttpProxyServerBootstrap.withSslEngineSource ### Description Sets the `SslEngineSource` for the proxy server bootstrap configuration. ### Method `withSslEngineSource(SslEngineSource sslEngineSource)` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response None ERROR HANDLING: None ``` -------------------------------- ### Get Client Address Source: https://javadoc.io/doc/org.littleshoot/littleproxy/1.1.2/org/littleshoot/proxy/impl/ClientToProxyConnection.html Retrieves the network address of the connected client. ```java public—InetSocketAddress—getClientAddress() ``` -------------------------------- ### serverSslEngine() Source: https://javadoc.io/doc/org.littleshoot/littleproxy/1.1.2/org/littleshoot/proxy/extras/SelfSignedMitmManager.html Creates an SSLEngine for encrypting the server connection. ```APIDOC ## serverSslEngine() ### Description Creates an `SSLEngine` for encrypting the server connection. Specified by: `serverSslEngine` in interface `MitmManager` ### Returns - an SSLEngine used to connect to an upstream server ``` -------------------------------- ### getIdleConnectionTimeout Source: https://javadoc.io/doc/org.littleshoot/littleproxy/1.1.2/org/littleshoot/proxy/impl/DefaultHttpProxyServer.html Gets the idle connection timeout setting for the proxy server. ```APIDOC ## getIdleConnectionTimeout ### Description Gets the idle connection timeout setting for the proxy server. ### Method ```java public int getIdleConnectionTimeout() ``` ### Returns The idle connection timeout in milliseconds. ``` -------------------------------- ### bootstrapFromFile Source: https://javadoc.io/doc/org.littleshoot/littleproxy/1.1.2/org/littleshoot/proxy/impl/DefaultHttpProxyServer.html Bootstrap a new DefaultHttpProxyServer using defaults from the given file. ```APIDOC ## bootstrapFromFile ### Description Bootstrap a new `DefaultHttpProxyServer` using defaults from the given file. ### Method ```java public static HttpProxyServerBootstrap bootstrapFromFile(String path) ``` ### Parameters #### Path Parameters - **path** (String) - The path to the configuration file. ### Returns An `HttpProxyServerBootstrap` instance. ``` -------------------------------- ### ClientToProxyConnection Constructor Source: https://javadoc.io/doc/org.littleshoot/littleproxy/1.1.2/org/littleshoot/proxy/impl/ClientToProxyConnection.html Initializes a new instance of the ClientToProxyConnection class. ```APIDOC ## ClientToProxyConnection(DefaultHttpProxyServer proxyServer, SslEngineSource sslEngineSource, boolean authenticateClients, ChannelPipeline pipeline, GlobalTrafficShapingHandler globalTrafficShapingHandler) ### Description Constructs a new ClientToProxyConnection with the specified proxy server, SSL engine source, authentication setting, channel pipeline, and traffic shaping handler. ### Parameters * **proxyServer** (DefaultHttpProxyServer) - The HTTP proxy server instance. * **sslEngineSource** (SslEngineSource) - The source for SSL engines. * **authenticateClients** (boolean) - Whether client authentication is required. * **pipeline** (ChannelPipeline) - The channel pipeline for the connection. * **globalTrafficShapingHandler** (GlobalTrafficShapingHandler) - The global traffic shaping handler. ``` -------------------------------- ### serverSslEngine() Source: https://javadoc.io/doc/org.littleshoot/littleproxy/1.1.2/org/littleshoot/proxy/MitmManager.html Creates an SSLEngine for encrypting the server connection. This is a simpler version when peer information is not needed. ```APIDOC ## serverSslEngine() ### Description Creates an `SSLEngine` for encrypting the server connection. ### Returns - an SSLEngine used to connect to an upstream server ``` -------------------------------- ### Get Flow Context Source: https://javadoc.io/doc/org.littleshoot/littleproxy/1.1.2/org/littleshoot/proxy/impl/ClientToProxyConnection.html Retrieves the flow context associated with the current connection. ```java private—FlowContext—flowContext() ``` -------------------------------- ### newSslEngine(String peerHost, int peerPort) Source: https://javadoc.io/doc/org.littleshoot/littleproxy/1.1.2/org/littleshoot/proxy/SslEngineSource.html Returns an SSLEngine to use for a client connection from LittleProxy to the upstream server. Peer information is needed to send the server_name extension in handshake with Server Name Indication (SNI). ```APIDOC ## newSslEngine(String peerHost, int peerPort) ### Description Returns an `SSLEngine` to use for a client connection from LittleProxy to the upstream server. Peer information is needed to send the server_name extension in handshake with Server Name Indication (SNI). ### Method `SSLEngine newSslEngine(String peerHost, int peerPort)` ### Parameters #### Path Parameters - **peerHost** (String) - Required - The hostname to start a client connection to the server. - **peerPort** (int) - Required - The port to start a client connection to the server. ### Returns `SSLEngine` ``` -------------------------------- ### getMaxInitialLineLength Source: https://javadoc.io/doc/org.littleshoot/littleproxy/1.1.2/org/littleshoot/proxy/impl/DefaultHttpProxyServer.html Gets the maximum length allowed for the initial HTTP request line. ```APIDOC ## getMaxInitialLineLength ### Description Gets the maximum length allowed for the initial HTTP request line. ### Method ```java public int getMaxInitialLineLength() ``` ### Returns The maximum initial line length in bytes. ``` -------------------------------- ### Get Acceptor Threads Source: https://javadoc.io/doc/org.littleshoot/littleproxy/1.1.2/org/littleshoot/proxy/impl/ThreadPoolConfiguration.html Retrieves the number of acceptor threads configured for the proxy. ```java public int getAcceptorThreads() ``` -------------------------------- ### Create Server SSLEngine with Host and Port Source: https://javadoc.io/doc/org.littleshoot/littleproxy/1.1.2/org/littleshoot/proxy/MitmManager.html Creates an SSLEngine for encrypting the server connection. This can use peer information to send SNI when connecting upstream. ```java SSLEngine serverSslEngine(String peerHost, int peerPort) ``` -------------------------------- ### getProxyToServerWorkerPool Source: https://javadoc.io/doc/org.littleshoot/littleproxy/1.1.2/org/littleshoot/proxy/impl/ProxyThreadPools.html Gets the `NioEventLoopGroup` used for making outgoing connections from the proxy to servers. ```APIDOC ## getProxyToServerWorkerPool ### Description Gets the `NioEventLoopGroup` used for making outgoing connections from the proxy to servers. ### Method `public NioEventLoopGroup getProxyToServerWorkerPool()` ``` -------------------------------- ### ClientToProxyConnection Constructor Source: https://javadoc.io/doc/org.littleshoot/littleproxy/1.1.2/org/littleshoot/proxy/impl/ClientToProxyConnection.html Initializes a new ClientToProxyConnection. Requires the proxy server instance, SSL engine source, client authentication flag, channel pipeline, and global traffic shaping handler. ```java ClientToProxyConnection(DefaultHttpProxyServer proxyServer, SslEngineSource sslEngineSource, boolean authenticateClients, ChannelPipeline pipeline, GlobalTrafficShapingHandler globalTrafficShapingHandler) ``` -------------------------------- ### getClientToProxyWorkerPool Source: https://javadoc.io/doc/org.littleshoot/littleproxy/1.1.2/org/littleshoot/proxy/impl/ProxyThreadPools.html Gets the `NioEventLoopGroup` responsible for processing incoming client requests to the proxy. ```APIDOC ## getClientToProxyWorkerPool ### Description Gets the `NioEventLoopGroup` responsible for processing incoming client requests to the proxy. ### Method `public NioEventLoopGroup getClientToProxyWorkerPool()` ``` -------------------------------- ### serverSslEngine(String peerHost, int peerPort) Source: https://javadoc.io/doc/org.littleshoot/littleproxy/1.1.2/org/littleshoot/proxy/MitmManager.html Creates an SSLEngine for encrypting the server connection. This method can use the provided peer information to send SNI information when connecting to the upstream host. ```APIDOC ## serverSslEngine(String peerHost, int peerPort) ### Description Creates an `SSLEngine` for encrypting the server connection. The SSLEngine created by this method may use the given peer information to send SNI information when connecting to the upstream host. ### Parameters #### Path Parameters - **peerHost** (String) - Required - The hostname to start a client connection to the server. - **peerPort** (int) - Required - The port to start a client connection to the server. ### Returns - an SSLEngine used to connect to an upstream server ``` -------------------------------- ### getClientToProxyAcceptorPool Source: https://javadoc.io/doc/org.littleshoot/littleproxy/1.1.2/org/littleshoot/proxy/impl/ProxyThreadPools.html Gets the `NioEventLoopGroup` responsible for accepting incoming client connections to the proxy. ```APIDOC ## getClientToProxyAcceptorPool ### Description Gets the `NioEventLoopGroup` responsible for accepting incoming client connections to the proxy. ### Method `public NioEventLoopGroup getClientToProxyAcceptorPool()` ``` -------------------------------- ### DefaultHttpProxyServer Bootstrap Methods Source: https://javadoc.io/doc/org.littleshoot/littleproxy/1.1.2/org/littleshoot/proxy/class-use/HttpProxyServerBootstrap.html Static methods on DefaultHttpProxyServer to create and bootstrap an HTTP proxy server. ```APIDOC ## DefaultHttpProxyServer.bootstrap ### Description Bootstrap a new `DefaultHttpProxyServer` starting from scratch. ### Method Signature `static HttpProxyServerBootstrap bootstrap()` ## DefaultHttpProxyServer.bootstrapFromFile ### Description Bootstrap a new `DefaultHttpProxyServer` using defaults from the given file. ### Method Signature `static HttpProxyServerBootstrap bootstrapFromFile(String path)` ### Parameters - **path** (String) - The path to the configuration file. ``` -------------------------------- ### TransportProtocol Enum Constants Source: https://javadoc.io/doc/org.littleshoot/littleproxy/1.1.2/org/littleshoot/proxy/class-use/TransportProtocol.html Provides information on how to get all available TransportProtocol constants. ```APIDOC ## values() ### Description Returns an array containing the constants of this enum type, in the order they are declared. ### Method `static TransportProtocol[] values()` ### Return Value An array containing all enum constants. ``` -------------------------------- ### newSslEngine(String peerHost, int peerPort) for Client Connections Source: https://javadoc.io/doc/org.littleshoot/littleproxy/1.1.2/org/littleshoot/proxy/extras/SelfSignedSslEngineSource.html Returns an SSLEngine for client connections from LittleProxy to the upstream server. Peer information is used to send the server_name extension in the handshake with Server Name Indication (SNI). ```java public SSLEngine newSslEngine(String peerHost, int peerPort) ``` -------------------------------- ### newSslEngine() Source: https://javadoc.io/doc/org.littleshoot/littleproxy/1.1.2/org/littleshoot/proxy/SslEngineSource.html Returns an SSLEngine to use for a server connection from LittleProxy to the client. ```APIDOC ## newSslEngine() ### Description Returns an `SSLEngine` to use for a server connection from LittleProxy to the client. ### Method `SSLEngine newSslEngine()` ### Returns `SSLEngine` ``` -------------------------------- ### Get Idle Connection Timeout Source: https://javadoc.io/doc/org.littleshoot/littleproxy/1.1.2/org/littleshoot/proxy/HttpProxyServer.html Retrieves the timeout duration for idle connections. ```java int getIdleConnectionTimeout() ``` -------------------------------- ### DefaultHttpProxyServer Bootstrap Source: https://javadoc.io/doc/org.littleshoot/littleproxy/1.1.2/index-all.html Methods for creating and configuring an HTTP proxy server instance. ```APIDOC ## DefaultHttpProxyServer ### Methods #### `static DefaultHttpProxyServer bootstrap() Bootstrap a new `DefaultHttpProxyServer` starting from scratch. #### `static DefaultHttpProxyServer bootstrapFromFile(String filePath) Bootstrap a new `DefaultHttpProxyServer` using defaults from the given file. ``` -------------------------------- ### Create Server SSLEngine Source: https://javadoc.io/doc/org.littleshoot/littleproxy/1.1.2/org/littleshoot/proxy/MitmManager.html Creates a generic SSLEngine for encrypting the server connection. Use this when specific peer information is not required. ```java SSLEngine serverSslEngine() ``` -------------------------------- ### ServerGroup.getClientToProxyAcceptorPoolForTransport Source: https://javadoc.io/doc/org.littleshoot/littleproxy/1.1.2/org/littleshoot/proxy/class-use/TransportProtocol.html Gets the thread pool for accepting client connections for a specific transport protocol. ```APIDOC ## getClientToProxyAcceptorPoolForTransport(TransportProtocol protocol) ### Description Retrieves the client-to-proxy acceptor thread pool for the specified protocol. ### Method `EventLoopGroup getClientToProxyAcceptorPoolForTransport(TransportProtocol protocol)` ### Parameters #### Path Parameters - **protocol** (TransportProtocol) - Required - The transport protocol for which to get the acceptor pool. ``` -------------------------------- ### DefaultHttpProxyServerBootstrap Full Constructor Source: https://javadoc.io/doc/org.littleshoot/littleproxy/1.1.2/org/littleshoot/proxy/impl/DefaultHttpProxyServer.DefaultHttpProxyServerBootstrap.html Private constructor for DefaultHttpProxyServerBootstrap with extensive configuration options. ```java private DefaultHttpProxyServerBootstrap(ServerGroup serverGroup, TransportProtocol transportProtocol, InetSocketAddress requestedAddress, SslEngineSource sslEngineSource, boolean authenticateSslClients, ProxyAuthenticator proxyAuthenticator, ChainedProxyManager chainProxyManager, MitmManager mitmManager, HttpFiltersSource filtersSource, boolean transparent, int idleConnectionTimeout, Collection activityTrackers, int connectTimeout, HostResolver serverResolver, long readThrottleBytesPerSecond, long writeThrottleBytesPerSecond, InetSocketAddress localAddress, String proxyAlias, int maxInitialLineLength, int maxHeaderSize, int maxChunkSize, boolean allowRequestToOriginServer) ``` -------------------------------- ### DefaultHttpProxyServer.DefaultHttpProxyServerBootstrap Constructor Source: https://javadoc.io/doc/org.littleshoot/littleproxy/1.1.2/org/littleshoot/proxy/class-use/ChainedProxyManager.html This constructor for DefaultHttpProxyServer.DefaultHttpProxyServerBootstrap accepts a ChainedProxyManager, enabling the configuration of chained proxy settings during the bootstrap process. ```APIDOC ## DefaultHttpProxyServer.DefaultHttpProxyServerBootstrap Constructor ### Description Initializes a new bootstrap for creating an HTTP proxy server, with the option to configure a `ChainedProxyManager`. ### Constructor Signature `DefaultHttpProxyServerBootstrap(ServerGroup serverGroup, TransportProtocol transportProtocol, InetSocketAddress requestedAddress, SslEngineSource sslEngineSource, boolean authenticateSslClients, ProxyAuthenticator proxyAuthenticator, ChainedProxyManager chainProxyManager, MitmManager mitmManager, HttpFiltersSource filtersSource, boolean transparent, int idleConnectionTimeout, Collection activityTrackers, int connectTimeout, HostResolver serverResolver, long readThrottleBytesPerSecond, long writeThrottleBytesPerSecond, InetSocketAddress localAddress, String proxyAlias, int maxInitialLineLength, int maxHeaderSize, int maxChunkSize, boolean allowRequestToOriginServer)` ### Parameters * **chainProxyManager** (`ChainedProxyManager`) - The chained proxy manager to be used. ``` -------------------------------- ### ServerGroup.getProxyToServerWorkerPoolForTransport Source: https://javadoc.io/doc/org.littleshoot/littleproxy/1.1.2/org/littleshoot/proxy/class-use/TransportProtocol.html Gets the thread pool for handling proxy-to-server worker tasks for a specific transport protocol. ```APIDOC ## getProxyToServerWorkerPoolForTransport(TransportProtocol protocol) ### Description Retrieves the proxy-to-server worker thread pool for the specified protocol. ### Method `EventLoopGroup getProxyToServerWorkerPoolForTransport(TransportProtocol protocol)` ### Parameters #### Path Parameters - **protocol** (TransportProtocol) - Required - The transport protocol for which to get the worker pool. ``` -------------------------------- ### DefaultHttpProxyServer Constructor Source: https://javadoc.io/doc/org.littleshoot/littleproxy/1.1.2/index-all.html Primary implementation of an HttpProxyServer. ```APIDOC ## DefaultHttpProxyServer(...) ### Description Creates a new proxy server with numerous configuration options. ### Method N/A (Java Constructor) ### Endpoint N/A ### Parameters N/A ### Request Example N/A ### Response N/A ``` -------------------------------- ### ServerGroup.getClientToProxyWorkerPoolForTransport Source: https://javadoc.io/doc/org.littleshoot/littleproxy/1.1.2/org/littleshoot/proxy/class-use/TransportProtocol.html Gets the thread pool for handling client-to-proxy worker tasks for a specific transport protocol. ```APIDOC ## getClientToProxyWorkerPoolForTransport(TransportProtocol protocol) ### Description Retrieves the client-to-proxy worker thread pool for the specified protocol. ### Method `EventLoopGroup getClientToProxyWorkerPoolForTransport(TransportProtocol protocol)` ### Parameters #### Path Parameters - **protocol** (TransportProtocol) - Required - The transport protocol for which to get the worker pool. ``` -------------------------------- ### HttpProxyServerBootstrap Configuration Methods Source: https://javadoc.io/doc/org.littleshoot/littleproxy/1.1.2/org/littleshoot/proxy/class-use/HttpProxyServerBootstrap.html Methods available on HttpProxyServerBootstrap to configure the proxy server's behavior and settings. ```APIDOC ## HttpProxyServerBootstrap Methods ### Description Methods for configuring an HTTP proxy server. ### Methods - `HttpProxyServer.clone()`: Clones the existing server, with a port 1 higher and everything else the same. - `HttpProxyServerBootstrap.plusActivityTracker(ActivityTracker activityTracker)`: Adds an `ActivityTracker` for tracking activity in this proxy. - `HttpProxyServerBootstrap.withAddress(InetSocketAddress address)`: Listens for incoming connections on the given address. - `HttpProxyServerBootstrap.withAllowLocalOnly(boolean allowLocalOnly)`: Specifies whether or not to only allow local connections. - `HttpProxyServerBootstrap.withAllowRequestToOriginServer(boolean allowRequestToOriginServer)`: When true, the proxy will accept requests that appear to be directed at an origin server. - `HttpProxyServerBootstrap.withAuthenticateSslClients(boolean authenticateSslClients)`: Specifies whether or not to authenticate inbound SSL clients (only applies if `withSslEngineSource(SslEngineSource)` has been set). - `HttpProxyServerBootstrap.withChainProxyManager(ChainedProxyManager chainProxyManager)`: Specifies a `ChainedProxyManager` to use for chaining requests to another proxy. - `HttpProxyServerBootstrap.withConnectTimeout(int connectTimeout)`: Specifies the timeout for connecting to the upstream server on a new connection, in milliseconds. - `HttpProxyServerBootstrap.withFiltersSource(HttpFiltersSource filtersSource)`: Specifies a `HttpFiltersSource` to use for filtering requests and/or responses through this proxy. - `HttpProxyServerBootstrap.withIdleConnectionTimeout(int idleConnectionTimeout)`: Specifies the timeout after which to disconnect idle connections, in seconds. - `HttpProxyServerBootstrap.withListenOnAllAddresses(boolean listenOnAllAddresses)`: Deprecated. Use `withNetworkInterface(InetSocketAddress)` to avoid listening on all local addresses. - `HttpProxyServerBootstrap.withManInTheMiddle(MitmManager mitmManager)`: Specifies an `MitmManager` to use for making this proxy act as an SSL man in the middle. - `HttpProxyServerBootstrap.withMaxChunkSize(int maxChunkSize)`: Sets the maximum chunk size. - `HttpProxyServerBootstrap.withMaxHeaderSize(int maxHeaderSize)`: Sets the maximum header size. - `HttpProxyServerBootstrap.withMaxInitialLineLength(int maxInitialLineLength)`: Sets the maximum initial line length. - `HttpProxyServerBootstrap.withName(String name)`: Gives the server a name (used for naming threads, useful for logging). - `HttpProxyServerBootstrap.withNetworkInterface(InetSocketAddress inetSocketAddress)`: Routes all outgoing communication of the proxy instance via the given network interface. - `HttpProxyServerBootstrap.withPort(int port)`: Listens for incoming connections on the given port. - `HttpProxyServerBootstrap.withProxyAlias(String alias)`: Sets the alias to use when adding Via headers to incoming and outgoing HTTP messages. - `HttpProxyServerBootstrap.withProxyAuthenticator(ProxyAuthenticator proxyAuthenticator)`: Specifies a `ProxyAuthenticator` to use for doing basic HTTP authentication of clients. - `HttpProxyServerBootstrap.withServerResolver(HostResolver serverResolver)`: Specifies a custom `HostResolver` for resolving server addresses. - `HttpProxyServerBootstrap.withSslEngineSource(SslEngineSource sslEngineSource)`: Specifies an `SslEngineSource` to use for encrypting inbound connections. - `HttpProxyServerBootstrap.withThreadPoolConfiguration(ThreadPoolConfiguration configuration)`: Sets the configuration parameters for the proxy's thread pools. ``` -------------------------------- ### HttpFiltersSourceAdapter Constructor Source: https://javadoc.io/doc/org.littleshoot/littleproxy/1.1.2/org/littleshoot/proxy/HttpFiltersSourceAdapter.html The default constructor for HttpFiltersSourceAdapter. No specific setup is required to use this base class. ```java public HttpFiltersSourceAdapter() ``` -------------------------------- ### Configuration and Getters Source: https://javadoc.io/doc/org.littleshoot/littleproxy/1.1.2/org/littleshoot/proxy/impl/DefaultHttpProxyServer.html Methods for configuring and retrieving settings of the HTTP proxy server. ```APIDOC ## Configuration and Getters ### clone() Clone the existing server, with a port 1 higher and everything else the same. ### getConnectTimeout() Returns the maximum time to wait, in milliseconds, to connect to a server. ### setConnectTimeout(int connectTimeoutMs) Sets the maximum time to wait, in milliseconds, to connect to a server. ### getIdleConnectionTimeout() Returns the idle connection timeout setting. ### setIdleConnectionTimeout(int idleConnectionTimeout) Sets the idle connection timeout. ### setThrottle(long readThrottleBytesPerSecond, long writeThrottleBytesPerSecond) Set the read/write throttle bandwidths (in bytes/second) for this proxy. ### getReadThrottle() Returns the current read throttle setting. ### getWriteThrottle() Returns the current write throttle setting. ### getListenAddress() Return the address on which this proxy is listening. ### getLocalAddress() Returns the local address of the proxy. ### getServerResolver() Returns the host resolver used by the proxy. ### getFiltersSource() Returns the source for HTTP filters. ### getMitmManager() Returns the MitmManager used by the proxy. ### getProxyAuthenticator() Returns the ProxyAuthenticator used by the proxy. ### getChainProxyManager() Returns the ChainedProxyManager used by the proxy. ### getSslEngineSource() Returns the SslEngineSource used by the proxy. ### isAllowRequestsToOriginServer() Checks if requests to the origin server are allowed. ### getMaxChunkSize() Returns the maximum chunk size. ### getMaxHeaderSize() Returns the maximum header size. ### getMaxInitialLineLength() Returns the maximum initial line length. ### getProxyAlias() Returns the proxy alias. ``` -------------------------------- ### Get Proxy-to-Server Worker Pool Source: https://javadoc.io/doc/org.littleshoot/littleproxy/1.1.2/org/littleshoot/proxy/impl/ServerGroup.html Retrieves the proxy-to-server worker thread pool for a specific transport protocol. ```APIDOC ## getProxyToServerWorkerPoolForTransport(TransportProtocol protocol) ### Description Retrieves the proxy-to-server worker thread pool for the specified transport protocol. These threads handle outgoing requests to backend servers. ### Method `EventLoopGroup` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Method Signature `EventLoopGroup getProxyToServerWorkerPoolForTransport(TransportProtocol protocol)` ``` -------------------------------- ### HttpProxyServerBootstrap.withSslEngineSource Source: https://javadoc.io/doc/org.littleshoot/littleproxy/1.1.2/org/littleshoot/proxy/class-use/SslEngineSource.html This method allows you to specify an SslEngineSource for encrypting inbound connections to the proxy server. ```APIDOC ## HttpProxyServerBootstrap.withSslEngineSource ### Description Specify an `SslEngineSource` to use for encrypting inbound connections. ### Method `withSslEngineSource(SslEngineSource sslEngineSource)` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response None ERROR HANDLING: None ``` -------------------------------- ### Get Client-to-Proxy Worker Pool Source: https://javadoc.io/doc/org.littleshoot/littleproxy/1.1.2/org/littleshoot/proxy/impl/ServerGroup.html Retrieves the client-to-proxy worker thread pool for a specific transport protocol. ```APIDOC ## getClientToProxyWorkerPoolForTransport(TransportProtocol protocol) ### Description Retrieves the client-to-proxy worker thread pool for the specified transport protocol. These threads handle the actual processing of client requests. ### Method `EventLoopGroup` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Method Signature `EventLoopGroup getClientToProxyWorkerPoolForTransport(TransportProtocol protocol)` ``` -------------------------------- ### Get Client-to-Proxy Acceptor Pool Source: https://javadoc.io/doc/org.littleshoot/littleproxy/1.1.2/org/littleshoot/proxy/impl/ServerGroup.html Retrieves the client-to-proxy acceptor thread pool for a specific transport protocol. ```APIDOC ## getClientToProxyAcceptorPoolForTransport(TransportProtocol protocol) ### Description Retrieves the client-to-proxy acceptor thread pool for the specified transport protocol (e.g., TCP, TLS). ### Method `EventLoopGroup` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Method Signature `EventLoopGroup getClientToProxyAcceptorPoolForTransport(TransportProtocol protocol)` ``` -------------------------------- ### newSslEngine() for Server Connections Source: https://javadoc.io/doc/org.littleshoot/littleproxy/1.1.2/org/littleshoot/proxy/extras/SelfSignedSslEngineSource.html Returns an SSLEngine for server connections from LittleProxy to the client. This is used when LittleProxy acts as a server. ```java public SSLEngine newSslEngine() ``` -------------------------------- ### HttpProxyServerBootstrap Configuration Methods Source: https://javadoc.io/doc/org.littleshoot/littleproxy/1.1.2/org/littleshoot/proxy/class-use/HttpProxyServerBootstrap.html Methods available on HttpProxyServerBootstrap for configuring various aspects of the proxy server, such as throttling, transparency, and transport protocol. ```APIDOC ## HttpProxyServerBootstrap.withThrottling ### Description Specify the read and/or write bandwidth throttles for this proxy server. ### Method Signature `HttpProxyServerBootstrap withThrottling(long readThrottleBytesPerSecond, long writeThrottleBytesPerSecond)` ### Parameters - **readThrottleBytesPerSecond** (long) - The maximum bytes per second to allow for reading. - **writeThrottleBytesPerSecond** (long) - The maximum bytes per second to allow for writing. ## HttpProxyServerBootstrap.withTransparent ### Description Specify whether or not to run this proxy as a transparent proxy. ### Method Signature `HttpProxyServerBootstrap withTransparent(boolean transparent)` ### Parameters - **transparent** (boolean) - True to enable transparent proxying, false otherwise. ## HttpProxyServerBootstrap.withTransportProtocol ### Description Specify the `TransportProtocol` to use for incoming connections. ### Method Signature `HttpProxyServerBootstrap withTransportProtocol(TransportProtocol transportProtocol)` ### Parameters - **transportProtocol** (TransportProtocol) - The transport protocol to use (e.g., TCP, UDP). ## HttpProxyServerBootstrap.withUseDnsSec ### Description Specify whether or not to use secure DNS lookups for outbound connections. ### Method Signature `HttpProxyServerBootstrap withUseDnsSec(boolean useDnsSec)` ### Parameters - **useDnsSec** (boolean) - True to enable DNSSEC, false otherwise. ``` -------------------------------- ### Get Client-to-Proxy Worker Threads Source: https://javadoc.io/doc/org.littleshoot/littleproxy/1.1.2/org/littleshoot/proxy/impl/ThreadPoolConfiguration.html Retrieves the number of worker threads responsible for processing client requests. ```java public int getClientToProxyWorkerThreads() ``` -------------------------------- ### initializeSSLContext Source: https://javadoc.io/doc/org.littleshoot/littleproxy/1.1.2/index-all.html Initializes the SSL Context for secure connections. ```APIDOC ## initializeSSLContext() ### Description Initialize the SSL Context. ### Method (Not specified in source, likely a utility method) ### Endpoint (Not applicable for this method) ### Parameters (No parameters specified in source) ### Request Example (Not applicable for this method) ### Response (Response type not specified in source) ### Response Example (Not applicable for this method) ``` -------------------------------- ### Get Proxy to Server Worker Pool Source: https://javadoc.io/doc/org.littleshoot/littleproxy/1.1.2/org/littleshoot/proxy/impl/ProxyThreadPools.html Returns the NioEventLoopGroup used for making outgoing connections to servers. ```java public NioEventLoopGroup getProxyToServerWorkerPool() ``` -------------------------------- ### Get Client to Proxy Worker Pool Source: https://javadoc.io/doc/org.littleshoot/littleproxy/1.1.2/org/littleshoot/proxy/impl/ProxyThreadPools.html Returns the NioEventLoopGroup responsible for processing incoming client requests. ```java public NioEventLoopGroup getClientToProxyWorkerPool() ``` -------------------------------- ### DefaultHttpProxyServer Constructor Source: https://javadoc.io/doc/org.littleshoot/littleproxy/1.1.2/org/littleshoot/proxy/class-use/ProxyAuthenticator.html Creates a new proxy server instance, optionally configuring it with a ProxyAuthenticator. ```APIDOC ## DefaultHttpProxyServer Constructor ### Description Creates a new proxy server. ### Method `DefaultHttpProxyServer` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response None ERROR HANDLING: None ``` -------------------------------- ### HttpProxyServerBootstrap Interface Methods Source: https://javadoc.io/doc/org.littleshoot/littleproxy/1.1.2/org/littleshoot/proxy/impl/DefaultHttpProxyServer.DefaultHttpProxyServerBootstrap.html Methods available on the HttpProxyServerBootstrap interface for configuring the proxy server. ```APIDOC ## plusActivityTracker ### Description Add an `ActivityTracker` for tracking activity in this proxy. ### Method `plusActivityTracker` ### Parameters - **activityTracker** (`ActivityTracker`) - The activity tracker to add. ### Returns `HttpProxyServerBootstrap` - The bootstrap instance for chaining. ## withAddress ### Description Listen for incoming connections on the given address. ### Method `withAddress` ### Parameters - **address** (`InetSocketAddress`) - The address to listen on. ### Returns `HttpProxyServerBootstrap` - The bootstrap instance for chaining. ## withAllowLocalOnly ### Description Specify whether or not to only allow local connections. ### Method `withAllowLocalOnly` ### Parameters - **allowLocalOnly** (`boolean`) - True to only allow local connections, false otherwise. ### Returns `HttpProxyServerBootstrap` - The bootstrap instance for chaining. ## withAllowRequestToOriginServer ### Description When true, the proxy will accept requests that appear to be directed at an origin server (i.e. requests with the Host header matching the origin server's hostname). ### Method `withAllowRequestToOriginServer` ### Parameters - **allowRequestToOriginServer** (`boolean`) - True to allow requests to the origin server, false otherwise. ### Returns `HttpProxyServerBootstrap` - The bootstrap instance for chaining. ``` -------------------------------- ### Get Client to Proxy Acceptor Pool Source: https://javadoc.io/doc/org.littleshoot/littleproxy/1.1.2/org/littleshoot/proxy/impl/ProxyThreadPools.html Returns the NioEventLoopGroup responsible for accepting incoming client connections. ```java public NioEventLoopGroup getClientToProxyAcceptorPool() ``` -------------------------------- ### Get Listen Address Source: https://javadoc.io/doc/org.littleshoot/littleproxy/1.1.2/org/littleshoot/proxy/HttpProxyServer.html Returns the network address on which the proxy server is currently listening for incoming connections. ```java InetSocketAddress getListenAddress() ``` -------------------------------- ### connectAndWrite Source: https://javadoc.io/doc/org.littleshoot/littleproxy/1.1.2/org/littleshoot/proxy/impl/ProxyToServerConnection.html Configures the connection to the upstream server and begins the ConnectionFlow. ```APIDOC ## connectAndWrite ### Description Configures the connection to the upstream server and begins the ConnectionFlow. ### Method private void connectAndWrite(HttpRequest initialRequest) ### Parameters #### Path Parameters - **initialRequest** (HttpRequest) - the current HTTP request being handled. ``` -------------------------------- ### getSslEngine Source: https://javadoc.io/doc/org.littleshoot/littleproxy/1.1.2/index-all.html Retrieves the SSL engine. ```APIDOC ## getSslEngine ### Description Retrieves the SSL engine. ### Method GET (Implied) ### Endpoint N/A (Method Signature) ### Parameters None ### Response #### Success Response (200) - **sslEngine** (SSLEngine) - The SSL engine. ``` -------------------------------- ### Iterating over ConnectionState Enum Constants Source: https://javadoc.io/doc/org.littleshoot/littleproxy/1.1.2/org/littleshoot/proxy/impl/ConnectionState.html Example of how to iterate over all constants of the ConnectionState enum using the values() method. ```java for (ConnectionState c : ConnectionState.values())   System.out.println(c); ``` -------------------------------- ### HttpProxyServer Source: https://javadoc.io/doc/org.littleshoot/littleproxy/1.1.2/org/littleshoot/proxy/package-summary.html The HttpProxyServer interface represents the top-level proxy server class. It allows for starting and stopping the proxy server. ```APIDOC ## HttpProxyServer ### Description Interface for the top-level proxy server class. ### Interface `HttpProxyServer` ``` -------------------------------- ### DefaultHttpProxyServer.DefaultHttpProxyServerBootstrap.withManInTheMiddle Source: https://javadoc.io/doc/org.littleshoot/littleproxy/1.1.2/org/littleshoot/proxy/class-use/MitmManager.html This method on the bootstrap class allows setting an MitmManager for SSL man-in-the-middle functionality. ```APIDOC ## DefaultHttpProxyServer.DefaultHttpProxyServerBootstrap.withManInTheMiddle ### Description Sets an `MitmManager` to enable SSL man-in-the-middle behavior for the proxy server being configured. ### Method `withManInTheMiddle(MitmManager mitmManager)` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response None ERROR HANDLING: None ``` -------------------------------- ### lookupChainedProxies Method Implementation Notes Source: https://javadoc.io/doc/org.littleshoot/littleproxy/1.1.2/org/littleshoot/proxy/ChainedProxyManager.html Provides guidance on implementing the `lookupChainedProxies` method. It explains how to add proxies to the queue, use `ChainedProxyAdapter.FALLBACK_TO_DIRECT_CONNECTION` for fallback, and leave the list empty to return a 502 error. ```java void lookupChainedProxies(HttpRequest httpRequest, Queue chainedProxies) { // Based on the given httpRequest, add any `ChainedProxy`s to the list that should be used to process the request. // The downstream proxy will attempt to connect to each of these in the order that they appear until it successfully connects to one. // To allow the proxy to fall back to a direct connection, you can add `ChainedProxyAdapter.FALLBACK_TO_DIRECT_CONNECTION` to the end of the list. // To keep the proxy from attempting any connection, leave the list blank. This will cause the proxy to return a 502 response. } ``` -------------------------------- ### Proxy to Server SSL Handshake Started Source: https://javadoc.io/doc/org.littleshoot/littleproxy/1.1.2/org/littleshoot/proxy/HttpFiltersAdapter.html Informs the filter that the SSL handshake for the proxy to server connection is initiating. ```java public void proxyToServerConnectionSSLHandshakeStarted() ``` -------------------------------- ### Get Connect Timeout Source: https://javadoc.io/doc/org.littleshoot/littleproxy/1.1.2/org/littleshoot/proxy/HttpProxyServer.html Retrieves the maximum duration, in milliseconds, the proxy will wait to establish a connection to a target server. ```java int getConnectTimeout() ``` -------------------------------- ### HttpProxyServerBootstrap.withManInTheMiddle Source: https://javadoc.io/doc/org.littleshoot/littleproxy/1.1.2/org/littleshoot/proxy/class-use/MitmManager.html This method allows you to specify an MitmManager to configure the proxy to act as an SSL man-in-the-middle. ```APIDOC ## HttpProxyServerBootstrap.withManInTheMiddle ### Description Specify an `MitmManager` to use for making this proxy act as an SSL man in the middle. ### Method `withManInTheMiddle(MitmManager mitmManager)` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response None ERROR HANDLING: None ``` -------------------------------- ### Get Local Address for Connection Source: https://javadoc.io/doc/org.littleshoot/littleproxy/1.1.2/org/littleshoot/proxy/ChainedProxy.html Optionally specifies the local address from which the connection should be opened, useful for NAT traversal. ```java InetSocketAddress getLocalAddress() ``` -------------------------------- ### create Source: https://javadoc.io/doc/org.littleshoot/littleproxy/1.1.2/index-all.html Create a new ProxyToServerConnection. ```APIDOC ## create(DefaultHttpProxyServer, ClientToProxyConnection, String, HttpFilters, HttpRequest, GlobalTrafficShapingHandler) ### Description Create a new ProxyToServerConnection. ### Method Static method ### Signature create(DefaultHttpProxyServer, ClientToProxyConnection, String, HttpFilters, HttpRequest, GlobalTrafficShapingHandler) ### Class org.littleshoot.proxy.impl.ProxyToServerConnection ``` -------------------------------- ### newSslEngine Method (SslEngineSource) Source: https://javadoc.io/doc/org.littleshoot/littleproxy/1.1.2/org/littleshoot/proxy/ChainedProxyAdapter.html Returns an SSLEngine for a server connection from LittleProxy to the client. This is part of the SslEngineSource interface. ```java public SSLEngine newSslEngine() ``` -------------------------------- ### Get Local Hostname Java Source: https://javadoc.io/doc/org.littleshoot/littleproxy/1.1.2/org/littleshoot/proxy/impl/ProxyUtils.html Attempts to resolve and return the hostname of the local machine. Returns null if the hostname cannot be determined. ```java public static String getHostName() ``` -------------------------------- ### newSslEngine Source: https://javadoc.io/doc/org.littleshoot/littleproxy/1.1.2/org/littleshoot/proxy/ChainedProxyAdapter.html Creates a new SSLEngine for establishing a client connection from LittleProxy to the upstream server. This method is part of the SslEngineSource interface. ```APIDOC ## newSslEngine ### Description Returns an SSLEngine to use for a client connection from LittleProxy to the upstream server. Note: Peer information is needed to send the server_name extension in handshake with Server Name Indication (SNI). ### Method public SSLEngine newSslEngine(String peerHost, int peerPort) ### Parameters * **peerHost** (String) - to start a client connection to the server. * **peerPort** (int) - to start a client connection to the server. ### Returns * SSLEngine - An SSLEngine for the client connection. ```