Red5 Documentation

WebSockets

WebSockets allows you to connect your JavaScript code on client-side to server-side Java code and create a low-latency remote method invocation or push notification mechanism. For example: you could create your own Red5 Pro Java application with business logic for real-time communication, data gathering and more, and access the methods from client-side using JavaScript. Quite useful! Especially since this is a low-latency technique that can be used in conjunction with the very low-latency video streaming on Red5 Pro Server. Here are few tips for using WebSockets on Red5 Pro.

Traditional systems of using Flash for a chat application involved connecting the Flash client to the application via a particular scope in Red5 Pro. A scope is a logical separation within Red5 Pro, much like directories on a hard drive. Scopes give you the advantage of better management of resources when building applications involving lots of connections. Traditionally scopes were used as “rooms” in chat applications.

A typical way of connecting to a Red5 Pro application via WebRTC is to use the following URL format: http://host:5080/{application} whereas connecting to a scope within the application, the URL format would be: http://host:5080/{application}/{scopename}. Since WebSocket is not used in WISH (WHIP/WHEP), it is not covered here.

An example chat application, written by the Red5 opensource team can be found at their github here..