addOns/network/src/main/java/org/zaproxy/addon/network/ExtensionNetwork.java
/**
     * Creates a HTTP proxy using an existing {@code HttpSender}.
     *
     * <p>The CONNECT requests are automatically handled as is the possible TLS upgrade. The
     * connection is automatically closed on recursive requests.
     *
     * @param httpSender the HTTP sender.
     * @param handler the message handler.
     * @return the server.
     * @throws NullPointerException if the HTTP sender and given handler are {@code null}.
     * @since 0.1.0
     */
Creates a HTTP proxy using an existing  HttpSender.
The CONNECT requests are automatically handled as is the possible TLS upgrade. The
connection is automatically closed on recursive requests.

@param httpSender the HTTP sender.
@param handler the message handler.
@return the server.
@throws NullPointerException if the HTTP sender and given handler are  null.
Creates a HTTP proxy using an existing HttpSender . The CONNECT requests are automatically handled as is the possible TLS upgrade . The connection is automatically closed on recursive requests . @param httpSender the HTTP sender . @param handler the message handler . @return the server . @throws NullPointerException if the HTTP sender and given handler are null .
public Server createHttpProxy(HttpSender httpSender, HttpMessageHandler handler) {
        Objects.requireNonNull(handler);
        Objects.requireNonNull(httpSender);
        List<HttpMessageHandler> handlers =
                Arrays.asList(
                        ConnectReceivedHandler.getSetAndOverrideInstance(),
                        CloseOnRecursiveRequestHandler.getInstance(),
                        RemoveAcceptEncodingHandler.getEnabledInstance(),
                        DecodeResponseHandler.getEnabledInstance(),
                        handler,
                        new HttpSenderHandler(
                                getModel().getOptionsParam().getConnectionParam(), httpSender));
        return createHttpServer(() -> new MainProxyHandler(legacyProxyListenerHandler, handlers));
    }
public Server createHttpProxy ( HttpSender httpSender , HttpMessageHandler handler ) { Objects . requireNonNull ( handler ) ; Objects . requireNonNull ( httpSender ) ; List < HttpMessageHandler > handlers = Arrays . asList ( ConnectReceivedHandler . getSetAndOverrideInstance ( ) , CloseOnRecursiveRequestHandler . getInstance ( ) , RemoveAcceptEncodingHandler . getEnabledInstance ( ) , DecodeResponseHandler . getEnabledInstance ( ) , handler , new HttpSenderHandler ( getModel ( ) . getOptionsParam ( ) . getConnectionParam ( ) , httpSender ) ) ; return createHttpServer ( ( ) -> new MainProxyHandler ( legacyProxyListenerHandler , handlers ) ) ; }
Creates a HTTP proxy using an existing {@code HttpSender}.
Creates a HTTP proxy using an existing { @code HttpSender } .