Skip to content

Commit 4e389c6

Browse files
committed
Add props for secure and websocket to red5.propeties. Simplify tomcat.server bean entry and allow secureEnable option to filter connector types
1 parent a61cda1 commit 4e389c6

File tree

12 files changed

+80
-63
lines changed

12 files changed

+80
-63
lines changed

client/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<parent>
44
<groupId>org.red5</groupId>
55
<artifactId>red5-parent</artifactId>
6-
<version>2.0.10</version>
6+
<version>2.0.11</version>
77
</parent>
88
<modelVersion>4.0.0</modelVersion>
99
<artifactId>red5-client</artifactId>

client/src/main/java/org/red5/client/Red5Client.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public final class Red5Client {
1818
/**
1919
* Current server version with revision
2020
*/
21-
public static final String VERSION = "Red5 Client 2.0.10";
21+
public static final String VERSION = "Red5 Client 2.0.11";
2222

2323
/**
2424
* Create a new Red5Client object using the connection local to the current thread A bit of magic that lets you access the red5 scope

common/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<parent>
44
<groupId>org.red5</groupId>
55
<artifactId>red5-parent</artifactId>
6-
<version>2.0.10</version>
6+
<version>2.0.11</version>
77
</parent>
88
<modelVersion>4.0.0</modelVersion>
99
<artifactId>red5-server-common</artifactId>
@@ -105,7 +105,7 @@
105105
<dependency>
106106
<groupId>net.engio</groupId>
107107
<artifactId>mbassador</artifactId>
108-
<version>2.0.10</version>
108+
<version>2.0.11</version>
109109
</dependency> -->
110110
<dependency>
111111
<groupId>junit</groupId>

common/src/main/java/org/red5/server/api/Red5.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,12 @@ public final class Red5 {
5757
/**
5858
* Server version with revision
5959
*/
60-
public static final String VERSION = "Red5 Server 2.0.10";
60+
public static final String VERSION = "Red5 Server 2.0.11";
6161

6262
/**
6363
* Server version for fmsVer requests
6464
*/
65-
public static final String FMS_VERSION = "RED5/2,0,10,0";
65+
public static final String FMS_VERSION = "RED5/2,0,11,0";
6666

6767
/**
6868
* Server capabilities

io/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<parent>
44
<groupId>org.red5</groupId>
55
<artifactId>red5-parent</artifactId>
6-
<version>2.0.10</version>
6+
<version>2.0.11</version>
77
</parent>
88
<modelVersion>4.0.0</modelVersion>
99
<artifactId>red5-io</artifactId>

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<name>Red5</name>
2525
<description>The Red5 server</description>
2626
<groupId>org.red5</groupId>
27-
<version>2.0.10</version>
27+
<version>2.0.11</version>
2828
<url>https://github.com/Red5/red5-server</url>
2929
<inceptionYear>2005</inceptionYear>
3030
<organization>

server/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<parent>
44
<groupId>org.red5</groupId>
55
<artifactId>red5-parent</artifactId>
6-
<version>2.0.10</version>
6+
<version>2.0.11</version>
77
</parent>
88
<modelVersion>4.0.0</modelVersion>
99
<artifactId>red5-server</artifactId>

server/src/main/java/org/red5/server/tomcat/TomcatLoader.java

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,11 @@ public boolean accept(File dir, String name) {
172172
*/
173173
protected boolean websocketEnabled = true;
174174

175+
/**
176+
* HTTPS/WSS feature
177+
*/
178+
protected boolean secureEnabled;
179+
175180
/**
176181
* Flag to indicate if we should await plugin loading
177182
*/
@@ -406,6 +411,11 @@ public void start() throws ServletException {
406411
for (TomcatConnector tomcatConnector : connectors) {
407412
// get the connector
408413
Connector connector = tomcatConnector.getConnector();
414+
// check for secure connector and skip it if secure is not enabled
415+
if (!secureEnabled && connector.getSecure()) {
416+
log.debug("Skipping secure connector");
417+
continue;
418+
}
409419
// add new Connector to set of Connectors for embedded server, associated with Engine
410420
if (!added) {
411421
embedded.setConnector(connector);
@@ -856,6 +866,24 @@ public void setWebsocketEnabled(boolean websocketEnabled) {
856866
this.websocketEnabled = websocketEnabled;
857867
}
858868

869+
/**
870+
* Returns enabled state of secure support.
871+
*
872+
* @return true if enabled and false otherwise
873+
*/
874+
public boolean isSecureEnabled() {
875+
return secureEnabled;
876+
}
877+
878+
/**
879+
* Set secure feature enabled / disabled.
880+
*
881+
* @param secureEnabled
882+
*/
883+
public void setSecureEnabled(boolean secureEnabled) {
884+
this.secureEnabled = secureEnabled;
885+
}
886+
859887
/**
860888
* Returns await plugin loading state.
861889
*

server/src/main/server/conf/jee-container.xml

Lines changed: 39 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,20 @@
55
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
66
http://www.springframework.org/schema/lang http://www.springframework.org/schema/lang/spring-lang.xsd">
77

8-
<!--
9-
The tomcat connectors may be blocking or non-blocking. Select between either option via the protocol property.
10-
Blocking I/O:
11-
<property name="protocol" value="org.apache.coyote.http11.Http11Protocol" />
12-
Non-blocking I/O:
13-
<property name="protocol" value="org.apache.coyote.http11.Http11Nio2Protocol" />
14-
-->
15-
<!-- Tomcat without SSL enabled -->
8+
<!-- Transports for HTTP/S and WS/S
9+
The tomcat connectors may be blocking or non-blocking. Select between either option via the protocol property.
10+
Blocking I/O:
11+
<property name="protocol" value="org.apache.coyote.http11.Http11Protocol" />
12+
Non-blocking I/O:
13+
<property name="protocol" value="org.apache.coyote.http11.Http11Nio2Protocol" />
14+
15+
Connection properties available for TomcatConnector in Red5 2.0.10:
16+
protocols="TLSv1.2,TLSv1.3"
17+
ciphers="TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384"
18+
-->
1619
<bean id="tomcat.server" class="org.red5.server.tomcat.TomcatLoader" depends-on="context.loader" lazy-init="true">
17-
<property name="awaitPlugins" value="false" />
18-
<property name="websocketEnabled" value="true" />
20+
<property name="secureEnabled" value="${secure.enabled}" />
21+
<property name="websocketEnabled" value="${websocket.enabled}" />
1922
<property name="webappFolder" value="${red5.root}/webapps" />
2023
<property name="connectors">
2124
<list>
@@ -28,68 +31,42 @@
2831
<entry key="maxHttpHeaderSize" value="${http.max_headers_size}"/>
2932
<entry key="maxKeepAliveRequests" value="${http.max_keep_alive_requests}"/>
3033
<entry key="keepAliveTimout" value="-1"/>
34+
<entry key="useExecutor" value="true"/>
35+
<entry key="maxThreads" value="${http.max_threads}"/>
36+
<entry key="acceptCount" value="100"/>
37+
<entry key="acceptorThreadCount" value="${http.acceptor_thread_count}"/>
38+
<entry key="processorCache" value="${http.processor_cache}"/>
39+
<entry key="connectionTimeout" value="20000"/>
40+
<entry key="maxConnections" value="-1"/>
41+
<entry key="relaxedQueryChars" value="[,]"/>
42+
<entry key="useLowerCaseHeaders" value="false"/>
3143
</map>
3244
</property>
3345
</bean>
34-
</list>
35-
</property>
36-
<property name="baseHost">
37-
<bean class="org.apache.catalina.core.StandardHost">
38-
<property name="name" value="${http.host}" />
39-
</bean>
40-
</property>
41-
<property name="valves">
42-
<list>
43-
<bean id="valve.access" class="org.apache.catalina.valves.AccessLogValve">
44-
<property name="directory" value="log" />
45-
<property name="prefix" value="${http.host}_access." />
46-
<property name="suffix" value=".log" />
47-
<property name="pattern" value="common" />
48-
<property name="rotatable" value="true" />
49-
</bean>
50-
</list>
51-
</property>
52-
</bean>
53-
54-
<!-- Tomcat with SSL enabled -->
55-
<!--
56-
<bean id="tomcat.server" class="org.red5.server.tomcat.TomcatLoader" depends-on="context.loader" lazy-init="true">
57-
<property name="websocketEnabled" value="true" />
58-
<property name="webappFolder" value="${red5.root}/webapps" />
59-
<property name="connectors">
60-
<list>
61-
<bean name="httpConnector" class="org.red5.server.tomcat.TomcatConnector">
62-
<property name="protocol" value="org.apache.coyote.http11.Http11Nio2Protocol" />
63-
<property name="address" value="${http.host}:${http.port}" />
64-
<property name="redirectPort" value="${https.port}" />
65-
</bean>
6646
<bean name="httpsConnector" class="org.red5.server.tomcat.TomcatConnector">
6747
<property name="secure" value="true" />
6848
<property name="protocol" value="org.apache.coyote.http11.Http11Nio2Protocol" />
6949
<property name="address" value="${http.host}:${https.port}" />
7050
<property name="redirectPort" value="${http.port}" />
7151
<property name="connectionProperties">
7252
<map>
73-
<entry key="port" value="${https.port}" />
74-
<entry key="redirectPort" value="${http.port}" />
75-
76-
<entry key="SSLEnabled" value="true" />
77-
<entry key="sslProtocol" value="TLS" />
53+
<entry key="keystoreType" value="JKS" />
7854
<entry key="keystoreFile" value="${rtmps.keystorefile}" />
7955
<entry key="keystorePass" value="${rtmps.keystorepass}" />
56+
<entry key="truststoreType" value="JKS" />
8057
<entry key="truststoreFile" value="${rtmps.truststorefile}" />
8158
<entry key="truststorePass" value="${rtmps.truststorepass}" />
82-
<entry key="clientAuth" value="false" />
83-
<entry key="allowUnsafeLegacyRenegotiation" value="true" />
84-
59+
<entry key="allowUnsafeLegacyRenegotiation" value="false" />
8560
<entry key="maxHttpHeaderSize" value="${http.max_headers_size}"/>
8661
<entry key="maxKeepAliveRequests" value="${http.max_keep_alive_requests}"/>
8762
<entry key="keepAliveTimout" value="-1"/>
88-
8963
<entry key="useExecutor" value="true"/>
9064
<entry key="maxThreads" value="${http.max_threads}"/>
9165
<entry key="acceptorThreadCount" value="${http.acceptor_thread_count}"/>
9266
<entry key="processorCache" value="${http.processor_cache}"/>
67+
<entry key="connectionTimeout" value="20000"/>
68+
<entry key="relaxedQueryChars" value="[,]"/>
69+
<entry key="useLowerCaseHeaders" value="false"/>
9370
</map>
9471
</property>
9572
</bean>
@@ -100,7 +77,17 @@
10077
<property name="name" value="${http.host}" />
10178
</bean>
10279
</property>
80+
<property name="valves">
81+
<list>
82+
<bean id="valve.access" class="org.apache.catalina.valves.AccessLogValve">
83+
<property name="directory" value="log" />
84+
<property name="prefix" value="${http.host}_access" />
85+
<property name="suffix" value=".log" />
86+
<property name="pattern" value="common" />
87+
<property name="rotatable" value="true" />
88+
</bean>
89+
</list>
90+
</property>
10391
</bean>
104-
-->
10592

10693
</beans>

server/src/main/server/conf/red5.properties

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ http.max_keep_alive_requests=-1
1212
http.max_threads=2000
1313
http.acceptor_thread_count=100
1414
http.processor_cache=200
15+
secure.enabled=false
16+
websocket.enabled=true
1517

1618
# RTMP
1719
rtmp.host=0.0.0.0

service/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<parent>
44
<groupId>org.red5</groupId>
55
<artifactId>red5-parent</artifactId>
6-
<version>2.0.10</version>
6+
<version>2.0.11</version>
77
</parent>
88
<modelVersion>4.0.0</modelVersion>
99
<artifactId>red5-service</artifactId>

servlet/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<parent>
44
<groupId>org.red5</groupId>
55
<artifactId>red5-parent</artifactId>
6-
<version>2.0.10</version>
6+
<version>2.0.11</version>
77
</parent>
88
<modelVersion>4.0.0</modelVersion>
99
<artifactId>red5-servlet</artifactId>

0 commit comments

Comments
 (0)