Skip to content

Commit 74e2ff3

Browse files
authored
Added SOP/CORS info
1 parent bce1674 commit 74e2ff3

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,33 @@ For clean-up add this to appStop():
109109
manager.stop();
110110
```
111111

112+
Security Features
113+
-------------------
114+
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:
115+
```xml
116+
<bean id="webSocketTransport" class="org.red5.net.websocket.WebSocketTransport">
117+
<property name="addresses">
118+
<list>
119+
<value>${ws.host}:${ws.port}</value>
120+
</list>
121+
</property>
122+
<property name="sameOriginPolicy" value="false" />
123+
<property name="crossOriginPolicy" value="true" />
124+
<property name="allowedOrigins">
125+
<array>
126+
<value>localhost</value>
127+
<value>red5.org</value>
128+
</array>
129+
</property>
130+
</bean>
131+
```
132+
Properties:
133+
* [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.
134+
* [crossOriginPolicy](https://www.w3.org/Security/wiki/CORS) - Enables or disables CORS. This option pairs with the `allowedOrigins` array.
135+
* 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.
136+
137+
138+
112139
Test Page
113140
-------------------
114141

0 commit comments

Comments
 (0)