<commit_before>package com.intuit.karate;

import com.intuit.karate.netty.NettyUtils;
import com.intuit.karate.netty.ProxyResponse;
import com.intuit.karate.netty.ProxyServer;
import io.netty.handler.codec.http.FullHttpResponse;
import io.netty.handler.codec.http.HttpHeaderNames;
import io.netty.handler.codec.http.HttpResponseStatus;
import java.io.File;
import org.junit.Test;
import org.slf4j.LoggerFactory;

/**
 *
 * @author pthomas3
 */
public class ProxyServerSslMain {

    private static final org.slf4j.Logger logger = LoggerFactory.getLogger(ProxyServerSslMain.class);

    private String html = FileUtils.toString(new File("src/test/java/com/intuit/karate/temp.html"));

    @Test
    public void testProxy() {
        ProxyServer server = new ProxyServer(8090,
                req -> {
                    if ("httpbin.org".equals(req.context.host)) {
                        FullHttpResponse response = NettyUtils.createResponse(HttpResponseStatus.OK, html);
                        response.headers().add(HttpHeaderNames.CONTENT_TYPE, "text/html");
                        return new ProxyResponse(req.context, req.request, response);
                    }
                    return null;
                },
                res -> {
                    if ("corte.si".equals(res.context.host) && res.isHtml()) {
                        logger.debug("returning html: {}", html);
                        return NettyUtils.transform(res.response, html);
                    }
                    return null;
                });
        server.waitSync();
    }

}
<commit_msg>fix build - realized that maven shade has implications we cant use netty core classes in the public api or tests<commit_after>package com.intuit.karate;

import com.intuit.karate.netty.NettyUtils;
import com.intuit.karate.netty.ProxyResponse;
import com.intuit.karate.netty.ProxyServer;
//import io.netty.handler.codec.http.FullHttpResponse;
//import io.netty.handler.codec.http.HttpHeaderNames;
//import io.netty.handler.codec.http.HttpResponseStatus;
import java.io.File;
import org.junit.Test;
import org.slf4j.LoggerFactory;

/**
 *
 * @author pthomas3
 */
public class ProxyServerSslMain {

    private static final org.slf4j.Logger logger = LoggerFactory.getLogger(ProxyServerSslMain.class);

    private String html = FileUtils.toString(new File("src/test/java/com/intuit/karate/temp.html"));

    @Test
    public void testProxy() {
        ProxyServer server = new ProxyServer(8090,
                req -> {
//                    if ("httpbin.org".equals(req.context.host)) {
//                        FullHttpResponse response = NettyUtils.createResponse(HttpResponseStatus.OK, html);
//                        response.headers().add(HttpHeaderNames.CONTENT_TYPE, "text/html");
//                        return new ProxyResponse(req.context, req.request, response);
//                    }
                    return null;
                },
                res -> {
                    if ("corte.si".equals(res.context.host) && res.isHtml()) {
                        logger.debug("returning html: {}", html);
                        return NettyUtils.transform(res.response, html);
                    }
                    return null;
                });
        server.waitSync();
    }

}

{'fraction_non_alphanumeric': 0.11313315134971186, 'fraction_numerical': 0.004246284501061571, 'mean_word_length': 2.0707635009310987, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1694677', 'n_tokens_mistral': 945, 'n_tokens_neox': 904, 'n_words': 165}