ant-media / Ant-Media-Server

Ant Media Server is a live streaming engine software that provides adaptive, ultra low latency streaming by using WebRTC technology with ~0.5 seconds latency. Ant Media Server is auto-scalable and it can run on-premise or on-cloud.
https://antmedia.io
Other
4.29k stars 636 forks source link

Suggested fix via chat gpt for jee-container.xml #6796

Open IVEN2024 opened 13 hours ago

IVEN2024 commented 13 hours ago

Suggested fix via chat gpt for jee-container.xml

<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:context="http://www.springframework.org/schema/context" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:lang="http://www.springframework.org/schema/lang" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/lang http://www.springframework.org/schema/lang/spring-lang.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">

<context:annotation-config></context:annotation-config>

<!-- War deployer -->
<bean id="warDeployer" class="org.red5.server.tomcat.WarDeployer">
    <property name="checkInterval" value="${war.deploy.server.check.interval}" />
    <property name="webappFolder" value="${red5.root}/webapps" />
    <!-- Expand war files prior to startup of the remaining services -->
    <property name="expandWars" value="true" />
</bean>

<!-- Server configuration -->
<bean id="server" class="org.red5.server.Server">
    <property name="address" value="${http.host}" />
    <property name="port" value="${http.port}" />

    <!-- Listener -->
    <property name="listeners">
        <list>
            <bean class="org.apache.catalina.core.AprLifecycleListener">
                <property name="SSLEngine" value="on" />
            </bean>
        </list>
    </property>

    <!-- Loader -->
    <property name="loader" ref="tomcat.server" />
</bean>

<!-- Tomcat Loader -->
<bean id="tomcat.server" class="org.red5.server.tomcat.TomcatLoader"
      depends-on="context.loader,warDeployer" lazy-init="true">
    <!-- cluster --><!-- property name="cluster" ref="tomcat.cluster" /--><!-- cluster -->
    <property name="webappFolder" value="${red5.root}/webapps" />

    <property name="connectors">
        <list>
            <!-- HTTP Connector -->
            <bean name="httpConnector" class="org.red5.server.tomcat.TomcatConnector">
                <property name="protocol" value="org.apache.coyote.http11.Http11Nio2Protocol" />
                <property name="address" value="${http.host}:${http.port}" />
                <property name="redirectPort" value="${https.port}" />

                <!-- Upgrade Protocols -->
                <property name="upgradeProtocols">
                    <list>
                        <bean class="org.apache.coyote.http2.Http2Protocol">
                            <property name="enableConnectProtocol" value="true" />
                        </bean>
                    </list>
                </property>

                <property name="connectionProperties">
                    <map>
                        <entry key="maxKeepAliveRequests" value="${http.max_keep_alive_requests}" />
                        <entry key="keepAliveTimeout" value="-1" />
                        <entry key="useExecutor" value="true"/>
                        <entry key="maxThreads" value="${http.max_threads}"/>
                        <entry key="acceptorThreadCount" value="${http.acceptor_thread_count}"/>
                        <entry key="processorCache" value="${http.processor_cache}"/>
                        <entry key="relaxedQueryChars" value="{}" />
                    </map>
                </property>
            </bean>

            <!-- HTTPS Connector -->
            <bean name="httpsConnector" class="org.red5.server.tomcat.TomcatConnector">
                <property name="secure" value="true" />
                <property name="protocol" value="org.apache.coyote.http11.Http11Nio2Protocol"/>
                <property name="address" value="${http.host}:${https.port}" />
                <property name="redirectPort" value="${http.port}" />

                <!-- Upgrade Protocols -->
                <property name="upgradeProtocols">
                    <list>
                        <bean class="org.apache.coyote.http2.Http2Protocol">
                            <property name="enableConnectProtocol" value="true" />
                        </bean>
                    </list>
                </property>

                <property name="connectionProperties">
                    <map>
                        <entry key="SSLEnabled" value="true" />
                        <entry key="sslEnabledProtocols" value="TLSv1.2,TLSv1.3" />
                        <entry key="useServerCipherSuitesOrder" value="true" />
                        <!-- Adjusted cipher suites -->
                        <entry key="ciphers" value="TLS_AES_128_GCM_SHA256,TLS_AES_256_GCM_SHA384,TLS_CHACHA20_POLY1305_SHA256,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384" />
                        <entry key="SSLCertificateFile" value="${http.ssl_certificate_file}" />
                        <entry key="SSLCertificateChainFile" value="${http.ssl_certificate_chain_file}" />
                        <entry key="SSLCertificateKeyFile" value="${http.ssl_certificate_key_file}" />
                        <entry key="clientAuth" value="false" />
                        <entry key="maxKeepAliveRequests" value="${http.max_keep_alive_requests}"/>
                        <entry key="keepAliveTimeout" value="-1"/>
                        <entry key="useExecutor" value="true"/>
                        <entry key="maxThreads" value="${http.max_threads}"/>
                        <entry key="acceptorThreadCount" value="${http.acceptor_thread_count}"/>
                        <entry key="processorCache" value="${http.processor_cache}"/>
                        <entry key="relaxedQueryChars" value="{}" />
                    </map>
                </property>
            </bean>
        </list>
    </property>

    <property name="baseHost">
        <bean class="org.apache.catalina.core.StandardHost">
            <property name="name" value="${http.host}" />
        </bean>
    </property>

    <property name="valves">
        <list>
            <!-- Remote IP Valve -->
            <bean id="valve.remoteIp" class="org.apache.catalina.valves.RemoteIpValve" />

            <!-- Access Log Valve -->
            <bean id="valve.accessLog" class="org.apache.catalina.valves.AccessLogValve">
                <property name="directory" value="log" />
                <property name="prefix" value="${http.host}_access" />
                <property name="suffix" value=".log" />
                <property name="pattern" value="common" />
                <property name="rotatable" value="true" />
                <property name="requestAttributesEnabled" value="true" />
                <property name="fileDateFormat" value="" />
            </bean>

            <!-- Data Transfer Valve -->
            <bean class="io.antmedia.valves.DataTransferValve">
                <property name="asyncSupported" value="true" />
            </bean>

            <!-- Cluster Valve (Commented Out) -->
            <!--
            <bean id="valve.cluster" class="io.antmedia.enterprise.cluster.HttpLiveStreamValve">
                <property name="asyncSupported" value="true" />
            </bean>
            -->
        </list>
    </property>
</bean>