You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: server/README-TomcatPlugin.md
+36-32Lines changed: 36 additions & 32 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,7 +21,7 @@ The IP addresses and ports identified for `ws` and `wss` in the `conf/jee-contai
21
21
22
22
### Building for JDK8
23
23
24
-
Use this command to build for JDK8 since we are currently moving over to JDK11 builds: `mvn clean install -Djava.release.level=8 -Dmaven.compiler.source=1.8 -Dmaven.compiler.target=1.8`
24
+
Use this command to build for JDK8 since we've moved to JDK11: `mvn clean install -Djava.release.level=8 -Dmaven.compiler.source=1.8 -Dmaven.compiler.target=1.8`
25
25
26
26
## Tomcat Server
27
27
@@ -34,8 +34,6 @@ Websocket plug-in is integrated into the Tomcat plugin as of this latest release
34
34
35
35
This plugin is meant to provide websocket functionality for applications running in red5. The code is constructed to comply with [rfc6455](http://tools.ietf.org/html/rfc6455) and [JSR365](https://www.oracle.com/technetwork/articles/java/jsr356-1937161.html).
36
36
37
-
38
-
39
37
The previous Red5 WebSocket plugin was developed with assistence from Takahiko Toda and Dhruv Chopra.
40
38
41
39
## Configuration
@@ -128,31 +126,31 @@ Update the `conf/jee-container.xml` file to suit your needs.
128
126
To bind to more than one IP address / port, add additional `httpConnector` or `httpsConnector` entries:
If you are not using unlimited strength JCE (ex. you are outside the USA), your cipher suite selections will fail if any containing `AES_256` are specified.
154
153
155
-
156
154
Adding WebSocket to an Application
157
155
------------------------
158
156
@@ -162,13 +160,16 @@ To enable websocket support in your application, add this to your appStart() met
Lastly, the websocket filter must be added to each web application that will act as a websocket end point. In the webapp descriptor `webapps/myapp/WEB-INF/web.xml` add this entry alongside any other filters or servlets.
172
+
172
173
```xml
173
174
<!-- WebSocket filter -->
174
175
<filter>
@@ -183,32 +184,36 @@ Lastly, the websocket filter must be added to each web application that will act
183
184
<dispatcher>FORWARD</dispatcher>
184
185
</filter-mapping>
185
186
```
187
+
186
188
To support subprotocols, add them as a comma-delimited string in the `web.xml`:
189
+
187
190
```xml
188
191
<!-- WebSocket subprotocols -->
189
192
<context-param>
190
193
<param-name>subProtocols</param-name>
191
194
<param-value>chat,json</param-value>
192
195
</context-param>
193
196
```
194
-
The plugin will default to allowing any requested subprotocol if none are specified.
195
197
198
+
The plugin will default to allowing any requested subprotocol if none are specified.
196
199
197
200
Extending the WebSocket Endpoint
198
201
---------------------------
199
202
Implementers may extend the default websocket endpoint class provided by this plugin `org.red5.net.websocket.server.DefaultWebSocketEndpoint`. The first step is to become familiar with the class and then `extend` it in your application; once that is complete, your class must be placed in the `lib` directory of your Red5 server, not the `webapps/yourapp/WEB-INF/lib` directory. Lastly, in your webapp descriptor `webapps/yourapp/WEB-INF/web.xml` file, an entry named `wsEndpointClass` will need to be made for your class:
One reason to extend the endpoint for your own use is because the default endpoint implementation only handles text data.
207
210
211
+
One reason to extend the endpoint for your own use is because the default endpoint implementation only handles text data.
208
212
209
213
Security Features
210
214
-------------------
211
215
Since WebSockets don't implement Same Origin Policy (SOP) nor Cross-Origin Resource Sharing (CORS), we've implemented a means to restrict access via configuration using SOP / CORS logic. To configure the security features, edit your `conf/jee-container.xml` file and locate the bean displayed below:
@@ -221,19 +226,19 @@ Since WebSockets don't implement Same Origin Policy (SOP) nor Cross-Origin Resou
221
226
</array>
222
227
</property>
223
228
```
224
-
Properties:
225
-
*[sameOriginPolicy](https://www.w3.org/Security/wiki/Same_Origin_Policy) - Enables or disables SOP. The logic differs from standard web SOP by *NOT* enforcing protocol and port.
226
-
*[crossOriginPolicy](https://www.w3.org/Security/wiki/CORS) - Enables or disables CORS. This option pairs with the `allowedOrigins` array.
227
-
* allowedOrigins - The list or host names or fqdn which are to be permitted access. The default if none are specified is `*` which equates to any or all.
228
-
229
229
230
+
Properties:
230
231
232
+
*[sameOriginPolicy](https://www.w3.org/Security/wiki/Same_Origin_Policy) - Enables or disables SOP. The logic differs from standard web SOP by *NOT* enforcing protocol and port.
233
+
*[crossOriginPolicy](https://www.w3.org/Security/wiki/CORS) - Enables or disables CORS. This option pairs with the `allowedOrigins` array.
234
+
* allowedOrigins - The list or host names or fqdn which are to be permitted access. The default if none are specified is `*` which equates to any or all.
235
+
231
236
Test Page
232
237
-------------------
233
238
234
239
Replace the wsUri variable with your applications path.
0 commit comments