<commit_before>package org.openforis.sepal.apigateway.server

import io.undertow.Undertow
import io.undertow.UndertowOptions
import org.xnio.Options

class ProxyServer {
    private Undertow server
    private final RootHandler handler

    ProxyServer(ProxyConfig config) {
        def sslContext = SslContextFactory.create(config.keyFile, config.certificateFile)
        handler = new RootHandler(config)
        def processorCount = Runtime.getRuntime().availableProcessors()
        server = Undertow.builder()
                .addHttpListener(config.httpPort, '0.0.0.0')
                .addHttpsListener(config.httpsPort, '0.0.0.0', sslContext)
                .setHandler(handler)
                .setIoThreads(processorCount)
                .setWorkerThreads(processorCount * 32)
                .setSocketOption(Options.WRITE_TIMEOUT, 60 * 1000)
                .setServerOption(UndertowOptions.REQUEST_PARSE_TIMEOUT, 60 * 1000)
                .setServerOption(UndertowOptions.NO_REQUEST_TIMEOUT, 60 * 1000)
                .build()
    }

    ProxyServer start() {
        server.start()
        return this
    }

    void stop() {
        server?.stop()
    }
}<commit_msg>Removed HTTPS listener from api-gateway.<commit_after>package org.openforis.sepal.apigateway.server

import io.undertow.Undertow
import io.undertow.UndertowOptions
import org.xnio.Options

class ProxyServer {
    private Undertow server
    private final RootHandler handler

    ProxyServer(ProxyConfig config) {
        handler = new RootHandler(config)
        def processorCount = Runtime.getRuntime().availableProcessors()
        server = Undertow.builder()
                .addHttpListener(config.httpPort, '0.0.0.0')
                .setHandler(handler)
                .setIoThreads(processorCount)
                .setWorkerThreads(processorCount * 32)
                .setSocketOption(Options.WRITE_TIMEOUT, 60 * 1000)
                .setServerOption(UndertowOptions.REQUEST_PARSE_TIMEOUT, 60 * 1000)
                .setServerOption(UndertowOptions.NO_REQUEST_TIMEOUT, 60 * 1000)
                .build()
    }

    ProxyServer start() {
        server.start()
        return this
    }

    void stop() {
        server?.stop()
    }
}
{'fraction_non_alphanumeric': 0.0885509838998211, 'fraction_numerical': 0.023255813953488372, 'mean_word_length': 2.374057315233786, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 3, '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': '2020709', 'n_tokens_mistral': 691, 'n_tokens_neox': 612, 'n_words': 113}