Skip to content

Websocket connections restriction by domain

Overview

Since build 5.2.792 it is possible to allow Websocket client connections by certain domain or domains list with the following parameter in flashphoner.properties file

allow_domains=wcs.mydomain.com

There can be listed a number of domains and subdomains, they will be checked until the first match 

allow_domains=mydomain.com,wcs.mydomain.com,myotherdomaincom,wcs2.myotherdomain.com

Mask (* character) is also supported, for example

allow_domains=*.mydomain.com,*.myotherdomain.com

The changes can be applied without restarting the server using CLI command

reload node-settings

Connection restriction from certain domains

Since build 5.2.971 it is possible to restrict Websocket connections from certain domains. For example, set the restrictions list as follows to forbid connections from one domain, but allow connections from all the other domains

allow_domains=!*.evildomain.com,*

Using the setting on CDN node

When using this parameter on CDN node, the CDN IP address of this node should be set in this list. For example, if node CDN IP is

cdn_ip=192.168.111.101

then this address should be added to allowed domains list

allow_domains=*.mydomain.com,*.myotherdomain.com,192.168.111.101