Frequently Asked Questions

How can I configure Red5 Pro to work with a proxy server?  

QUESTION:

I have a Red5 Pro server deployed on a private network with a proxy to the outside world. When I run the server it can’t get the license validation working. How can I configure Red5 Pro to work with the proxy server?

 
ANSWER:

By default, Red5 Pro is not configured to work with a proxy server. To make it work with a proxy server you need to provide the following flags to JVM during startup.

-Dhttp.proxyHost={{host}} -Dhttp.proxyPort={{port}} -Dhttps.proxyHost={{host}} -Dhttps.proxyPort={{port} \

Where :

  • -Dhttp.proxyHost defines the host or IP of the proxy for HTTP traffic
  • -Dhttp.proxyPort defines the port of the proxy for HTTP traffic
  • Dhttps.proxyHost defines the host or IP of the proxy for HTTPS traffic
  • -Dhttps.proxyPort defined the port of the proxy for HTTPS traffic

Given below is a sample Red5 Pro service file content, that includes proxy configuration flags for JVM. Make sure to substitute the {host} and {port} placeholders with actual values as applicable.

[Unit]
Description=Red5 Pro
After=syslog.target network.target[Service]
Type=forking
Environment=PID=/var/run/red5pro.pid
Environment=JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
LimitNOFILE=65536
Environment=RED5_HOME=/usr/local/red5pro
WorkingDirectory=/usr/local/red5pro
ExecStart=/usr/bin/jsvc -debug \
    -home ${JAVA_HOME} \
    -cwd ${RED5_HOME} \
    -cp ${RED5_HOME}/commons-daemon-1.1.0.jar:${RED5_HOME}/red5-service.jar:${RED5_HOME}/conf \
    -Dred5.root=${RED5_HOME} \
    -Djava.library.path=${RED5_HOME}/lib/amd64-Linux-gpp/jni \
    -Djava.security.debug=failure -Djava.security.egd=file:/dev/./urandom \
    -Dcatalina.home=${RED5_HOME} -Dcatalina.useNaming=true \
    -Dhttp.proxyHost={host} -Dhttp.proxyPort={port} -Dhttps.proxyHost={host} -Dhttps.proxyPort={port} \
    -Dorg.terracotta.quartz.skipUpdateCheck=true \
    -Xms101g -Xmx101g -Xverify:none \
    -XX:+TieredCompilation -XX:+UseBiasedLocking \
    -XX:MaxMetaspaceSize=128m -XX:+UseParNewGC -XX:+UseConcMarkSweepGC \
    -XX:InitialCodeCacheSize=8m -XX:ReservedCodeCacheSize=32m \
    -XX:CMSInitiatingOccupancyFraction=60 \
    -outfile ${RED5_HOME}/log/jsvc-service.log -errfile ${RED5_HOME}/log/jsvc-error.log \
    -wait 60 \
    -umask 011 \
    -pidfile ${PID} org.red5.daemon.EngineLauncher 9999
ExecStop=/usr/bin/jsvc -stop -pidfile ${PID} org.red5.daemon.EngineLauncher 9999[Install]
WantedBy=multi-user.target

Once you have edited the service file, ensure to save it, reload the service daemon and restart the server. for changes to apply.

NOTE: Editing the service ensures that the changes are always applied when the server restarts. You can optionally add the same flags to the red5.sh file if you prefer to start it manually.