red5-0.9.1 사이드 서버 구축

44229 단어 서버
red5 사이드 서버는mian 프레임워크를 통해 완성된 것입니다. 저는 사이드 서버가 클라이언트의 rtmp 요청을 받은 후에 원 서버에 전송하여 처리하는 것을 이해합니다.
사이드 서버의 클래스에 대한 개인적인 이해:
org.red5.server.net.rtmp.EdgeRTMPMinaIoHandler - 고객 연결 수신 후 ioSession 등록
org.red5.server.net.rtmp.RTMPConnManager - 클라이언트 연결 보유(ioSession)
 
org.red5.server.net.mrtmp.EdgeMRTMPhandler - 소스 서버 접속 성공 후 ioSession 등록
org.red5.server.net.mrtmp.SimpleMRTMPEDgeManager - 소스 서버 연결(ioSession)
 
주요 구성 파일은 다음과 같습니다.
소스:
conf/red5.properties - 주요 구성 포트 및 IP
conf/red5.xml - 상하문 설정, 서로 다른 모듈의spring 불러오기
conf/red5-origin-core.xml 소스 서비스의 핵심 설정
모서리:
conf/red5.properties - 주요 구성 포트 및 IP
conf/red5.xml - 상하문 설정, 서로 다른 모듈의spring 불러오기
conf/red5-edge-core.xml 사이드 서비스의 핵심 설정
 
내가 직면한 문제:
사이드 서비스는 원본 서비스에 요청을 전달할 수 없습니다. 문제를 조사한 후에 클래스org를 발견합니다.red5.server.net.rtmp.EdgeRTMPHandler(messageReceived 71) 변환 열거 유형 오류, Stream Action.valueOf(action), 다음 코드로 수정하여 정상적으로 실행
 
if (call.getServiceName() == null && !conn.isConnected()
					&& action.equals(StreamAction.CONNECT.toString())) {
				handleConnect(conn, channel, header, (Invoke) message, (RTMP) state);
				return;
			}

첨부 파일의red5-0.9.1.jar는 제가 수정한 것입니다. 이름은 red5입니다.jar는 원래의red5를 덮어씁니다.jar
 
 
주:red5의log 프로필은 일부 종류의 로그를 차단하고 자신의 상황에 따라conf/logback을 수정할 수 있습니다.xml 로그 파일 설정, 더 자세한 정보 보기
 
 
다음은 제가 실행에 성공한 어댑터 파일의 내용입니다.
1. 소스 서버, 주요 구성 파일
conf/red5.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:lang="http://www.springframework.org/schema/lang"
       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
                           http://www.springframework.org/schema/lang http://www.springframework.org/schema/lang/spring-lang-2.5.xsd">

	<!-- This file just wires together the context tree. Its accessed by ContextSingletonBeanFactoryLocator -->
	
	<bean id="placeholderConfig"
		class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
		<property name="location" value="classpath:/red5.properties" />
	</bean>

	<!-- First we load the common context, its shared between all the other contexts -->
	<!-- Global context serves are the parent to all child contexts. -->
	<bean id="red5.common"
  	    class="org.springframework.context.support.FileSystemXmlApplicationContext">
    	<constructor-arg><list><value>classpath:/red5-common.xml</value></list></constructor-arg>
	</bean>
	
	<!-- Then we load the core context, with the common as parent --> 
	<!-- Context holding all the networking, users should need to edit. -->
	<bean id="red5.core"
  	    class="org.springframework.context.support.FileSystemXmlApplicationContext">
    	<constructor-arg><list><value>classpath:/red5-origin-core.xml</value></list></constructor-arg>
    	<constructor-arg><ref bean="red5.common" /></constructor-arg>
	</bean>

	<!-- Then we load the global contexts, note its important this happens before app container loads -->
	<bean id="context.loader" 
		class="org.red5.server.ContextLoader"
		init-method="init">
		<property name="parentContext" ref="red5.core" />
		<property name="contextsConfig" value="classpath:red5.globals" />
	</bean>	
	
	<!-- Now we can load the servlet engine, this has to happen after the context are loaded -->
<!-- 
 	<bean id="jetty6.server" class="org.red5.server.jetty.JettyLoader" init-method="init" autowire="byType" depends-on="context.loader">
		<property name="webappFolder" value="${red5.root}/webapps" />
	</bean>
-->
	<!-- Tomcat servlet engine / http server -->
	<bean id="tomcat.server" class="org.red5.server.tomcat.TomcatLoader" init-method="init" destroy-method="shutdown" depends-on="context.loader">

		<property name="webappFolder" value="${red5.root}/webapps" />
			      
	    <property name="connector">
			<bean class="org.apache.catalina.connector.Connector">
				<constructor-arg type="java.lang.String" value="org.apache.coyote.http11.Http11Protocol" />
		        <property name="port"><value>${http.port}</value></property>
		        <property name="redirectPort"><value>${https.port}</value></property>
		        <property name="enableLookups"><value>false</value></property>
			</bean>
	    </property>
	    	
        <property name="baseHost">
	       <bean class="org.apache.catalina.core.StandardHost">
	           <property name="name" value="${http.host}" />
	           <property name="unpackWARs" value="true" />
	           <property name="autoDeploy" value="true" />
	           <property name="xmlValidation" value="false" />
	           <property name="xmlNamespaceAware" value="false" />
	       </bean>	   
	    </property>		

		<property name="valves">
      		<list>
	    		<bean id="valve.access" class="org.apache.catalina.valves.AccessLogValve">
	                <property name="directory" value="log" />
	                <property name="prefix" value="${http.host}_access." />
	                <property name="suffix" value=".log" />
	                <property name="pattern" value="common" />
	                <property name="resolveHosts" value="false" />
	                <property name="rotatable" value="true" />
	        	</bean>
        	</list>
        </property>
	    
	</bean>

<!--
	<bean id="tomcat.server" class="org.red5.server.tomcat.TomcatLoader" init-method="init" destroy-method="shutdown" autowire="byType" depends-on="context.loader">
		<!- - Note: the webapp root folder must be specified before the "contexts" property - ->
		<property name="webappFolder" value="${red5.root}/webapps" />
	
	    <property name="embedded">
	    	<bean class="org.apache.catalina.startup.Embedded" />
	    </property>
	  
	    <property name="engine">
			<bean class="org.apache.catalina.core.StandardEngine">
		        <property name="name" value="red5Engine" />
		        <property name="defaultHost" value="localhost" />
			</bean>	  
	    </property>
	    
	    <property name="realm">
	    	<bean class="org.apache.catalina.realm.MemoryRealm" />
		</property>
			      
	    <property name="connector">
			<bean class="org.apache.catalina.connector.Connector">
		        <property name="port"><value>5080</value></property>
		        <property name="redirectPort"><value>8443</value></property>
		        <property name="enableLookups"><value>false</value></property>
			</bean>
	    </property>
	    	
        <property name="baseHost">
	       <bean class="org.apache.catalina.core.StandardHost">
	           <property name="name" value="localhost" />
	           <property name="unpackWARs" value="true" />
	           <property name="autoDeploy" value="true" />
	           <property name="xmlValidation" value="false" />
	           <property name="xmlNamespaceAware" value="false" />
	       </bean>	   
	    </property>		

		<property name="valves">
      		<list>
	    		<bean id="valve.access" class="org.apache.catalina.valves.AccessLogValve">
	                <property name="directory" value="." />
	                <property name="prefix" value="localhost_access." />
	                <property name="suffix" value=".log" />
	                <property name="pattern" value="common" />
	                <property name="resolveHosts" value="false" />
	                <property name="rotatable" value="true" />
	        	</bean>
        	</list>
        </property>
	    
        <property name="contexts">
		    <map>
		      <entry>
		        <key><value>/</value></key>
		        <value>/root</value>
		      </entry>
		    </map>
  		</property>
	</bean>     	
-->
	<!-- Default context. This can be shared between web app contexts -->
	
	<bean id="default.context"
  	    class="org.springframework.context.support.FileSystemXmlApplicationContext">
    	<constructor-arg><value>/webapps/red5-default.xml</value></constructor-arg>
    	<constructor-arg><ref bean="red5.common" /></constructor-arg>
	</bean>
	
	<!-- You can add further contexts here. This allows for multiple separate global scopes --> 	
	
</beans>

 
conf/red5-origin-core.xml
<?xml version="1.0" encoding="UTF-8" ?>
<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns:lang="http://www.springframework.org/schema/lang"
	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd                            
	http://www.springframework.org/schema/lang http://www.springframework.org/schema/lang/spring-lang-2.5.xsd">
	<!-- This context holds all the networking: mina -->

	<bean id="customEditorConfigurer"
		class="org.springframework.beans.factory.config.CustomEditorConfigurer">
		<property name="customEditors">
			<map>
				<entry key="java.net.SocketAddress">
					<bean
						class="org.apache.mina.integration.beans.InetSocketAddressEditor" />
				</entry>
			</map>
		</property>
	</bean>
	
	<bean id="placeholderConfig"
		class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
		<property name="location" value="classpath:/red5.properties" />
	</bean>

	<!-- RTMP Handler -->
	<bean id="rtmpHandler"
		class="org.red5.server.net.rtmp.RTMPHandler">
		<property name="server" ref="red5.server" />
		<property name="statusObjectService" ref="statusObjectService" />
		<property name="globalScopeConnectionAllowed" value="true" />
	</bean>
	
	<bean id="mrtmpManager"
		class="org.red5.server.net.mrtmp.SimpleMRTMPOriginManager" >
		<property name="originMRTMPHandler" ref="mrtmpMinaIoHandler" />
	</bean>
	
	<bean id="mrtmpCodecFactory"
		class="org.red5.server.net.mrtmp.codec.MRTMPCodecFactory" />
	
	<!-- MRTMP Mina IO Handler -->
	<bean id="mrtmpMinaIoHandler"
		class="org.red5.server.net.mrtmp.OriginMRTMPHandler">
		<property name="handler" ref="rtmpHandler" />
		<property name="mrtmpManager" ref="mrtmpManager" />
		<property name="codecFactory" ref="mrtmpCodecFactory" />
	</bean> 
	
	<!-- MRTMP Mina Transport -->
	<bean id="mrtmpTransport" class="org.red5.server.net.mrtmp.MRTMPMinaTransport" init-method="start" destroy-method="stop">
		<property name="ioHandler" ref="mrtmpMinaIoHandler" />
		<property name="address" value="${mrtmp.host}" />
		<property name="port" value="${mrtmp.port}" />
		<property name="receiveBufferSize" value="${mrtmp.receive_buffer_size}" />
		<property name="sendBufferSize" value="${mrtmp.send_buffer_size}" />
		<property name="eventThreadsCore" value="${mrtmp.event_threads_core}" />
		<property name="eventThreadsMax" value="${mrtmp.event_threads_max}" />
		<property name="eventThreadsQueue" value="${mrtmp.event_threads_queue}" />
		<property name="eventThreadsKeepalive" value="${mrtmp.event_threads_keepalive}" />
		<property name="tcpNoDelay" value="${mrtmp.tcp_nodelay}" />
	</bean> 
	
	<!-- Uncomment this if you run Origin on a different server from Edge
	     and still want to use RTMP 
	<bean id="rtmpConnManager"
		class="org.red5.server.net.rtmp.RTMPConnManager">
	</bean>
	
	<bean id="rtmpMinaIoHandler"
		class="org.red5.server.net.rtmp.RTMPMinaIoHandler">
		<property name="handler" ref="rtmpHandler" />
		<property name="codecFactory" ref="rtmpCodecFactory" />
		<property name="rtmpConnManager" ref="rtmpConnManager" />
	</bean>
	
	<bean id="rtmpTransport" class="org.red5.server.net.rtmp.RTMPMinaTransport" init-method="start" destroy-method="stop">
		<property name="ioHandler" ref="rtmpMinaIoHandler" />
		<property name="address" value="${rtmp.host}" />
		<property name="port" value="${rtmp.port}" />
		<property name="receiveBufferSize" value="${rtmp.receive_buffer_size}" />
		<property name="sendBufferSize" value="${rtmp.send_buffer_size}" />
		<property name="eventThreadsCore" value="${rtmp.event_threads_core}" />
		<property name="eventThreadsMax" value="${rtmp.event_threads_max}" />
		<property name="eventThreadsQueue" value="${rtmp.event_threads_queue}" />
		<property name="eventThreadsKeepalive" value="${rtmp.event_threads_keepalive}" />
		<property name="jmxPollInterval" value="1000" />
		<property name="tcpNoDelay" value="${rtmp.tcp_nodelay}" />
	</bean>
	
	<bean id="rtmpMinaConnection" scope="prototype"
		class="org.red5.server.net.rtmp.RTMPMinaConnection">
		<property name="pingInterval" value="${rtmp.ping_interval}" />
		<property name="maxInactivity" value="${rtmp.max_inactivity}" />
		<property name="maxHandshakeTimeout" value="5000" />
	</bean>
	-->

	<bean id="rtmpMinaConnManager"
		class="org.red5.server.net.rtmp.RTMPConnManager">
	</bean>

	<bean id="rtmpMinaIoHandler"
		class="org.red5.server.net.rtmp.RTMPMinaIoHandler">
		<property name="handler" ref="rtmpHandler" />
		<property name="codecFactory" ref="rtmpCodecFactory" />
		<property name="rtmpConnManager" ref="rtmpMinaConnManager" />
	</bean>
	
	<!-- RTMP Mina Transport -->
	<bean id="rtmpTransport" class="org.red5.server.net.rtmp.RTMPMinaTransport" init-method="start" destroy-method="stop">
		<property name="ioHandler" ref="rtmpMinaIoHandler" />
        <property name="connectors">
            <list>
                <bean class="java.net.InetSocketAddress">
                    <constructor-arg index="0" type="java.lang.String" value="${rtmp.host}" />  
                    <constructor-arg index="1" type="int" value="${rtmp.port}" />  
                </bean>
                <!-- You can now add additional ports and ip addresses
                <bean class="java.net.InetSocketAddress">
                    <constructor-arg index="0" type="java.lang.String" value="${rtmp.host}" />  
                    <constructor-arg index="1" type="int" value="1936" />  
                </bean>
                 -->
            </list>
        </property>
		<property name="receiveBufferSize" value="${rtmp.receive_buffer_size}" />
		<property name="sendBufferSize" value="${rtmp.send_buffer_size}" />
		<property name="connectionThreads" value="${rtmp.connect_threads}" />
		<property name="ioThreads" value="${rtmp.io_threads}" />
		<!-- This is the interval at which the sessions are polled for stats. If mina monitoring is not
				enabled, polling will not occur. -->
		<property name="jmxPollInterval" value="1000" />
		<property name="tcpNoDelay" value="${rtmp.tcp_nodelay}" />
	</bean>
	
	<!-- RTMP Mina Connection -->
	<bean id="rtmpMinaConnection" scope="prototype"	class="org.red5.server.net.rtmp.RTMPMinaConnection">
		<!-- Ping clients every X ms. Set to 0 to disable ghost detection code. -->
		<property name="pingInterval" value="${rtmp.ping_interval}" />
		<!-- Disconnect client after X ms of not responding. -->
		<property name="maxInactivity" value="${rtmp.max_inactivity}" />
		<!-- Max. time in milliseconds to wait for a valid handshake. -->
		<property name="maxHandshakeTimeout" value="5000" />
	</bean>
	
	<!--
	 + The following configuration is for RTMPT.
	 -->
	<bean id="rtmptConnManager"
		class="org.red5.server.net.rtmp.RTMPConnManager">
	</bean>
	
	<!-- RTMPT Handler -->
	<bean id="rtmptHandler"
		class="org.red5.server.net.rtmpt.RTMPTHandler" autowire="byType">
		<property name="codecFactory" ref="rtmptCodecFactory" />
	</bean>
	
	<!-- Use injection to store RTMPT handler in servlet -->
	<bean id="rtmptServlet"
		class="org.red5.server.net.rtmpt.RTMPTServlet">
		<property name="handler" ref="rtmptHandler" />
		<property name="rtmpConnManager" ref="rtmptConnManager" />
	</bean>
	
	<!-- RTMPT Connection -->
	<bean id="rtmptConnection" scope="prototype"
		class="org.red5.server.net.rtmpt.RTMPTConnection">
		<!-- Ping clients every X ms. Set to 0 to disable ghost detection code. -->
		<property name="pingInterval" value="${rtmp.ping_interval}" />
		<!-- Disconnect client after X ms of not responding. -->
		<property name="maxInactivity" value="${rtmp.max_inactivity}" />
		<!-- Max. time in milliseconds to wait for a valid handshake. -->
		<property name="maxHandshakeTimeout" value="5000" />
	</bean>
	
	<!-- Jetty RTMPT Container -->
	<!-- 
	<bean id="rtmpt.server"
		class="org.red5.server.net.rtmpt.RTMPTLoader" init-method="init"
		autowire="byType" />
	-->	
	<!-- Tomcat Container -->
	<!-- 
	<bean id="rtmpt.server" class="org.red5.server.net.rtmpt.TomcatRTMPTLoader" init-method="init" lazy-init="true">
	
		<property name="webappFolder" value="${red5.root}/webapps" />
		
		<property name="connector">
			<bean class="org.apache.catalina.connector.Connector">
				<constructor-arg type="java.lang.String" value="org.apache.coyote.http11.Http11NioProtocol" />	
				<property name="port"><value>${rtmpt.port}</value></property>
				<property name="enableLookups"><value>false</value></property>
			</bean>
		</property>
		
		<property name="host">
			<bean class="org.apache.catalina.core.StandardHost">
				<property name="name" value="${rtmpt.host}" />
				<property name="unpackWARs" value="false" />
				<property name="autoDeploy" value="false" />
				<property name="xmlValidation" value="false" />
				<property name="xmlNamespaceAware" value="false" />
			</bean>	   
		</property>		

	</bean>
	-->

	<bean id="rtmpt.server" class="org.red5.server.tomcat.rtmpt.RTMPTLoader" init-method="init" lazy-init="true">
	
		<property name="webappFolder" value="${red5.root}/webapps" />
		
		<property name="connector">
			<bean class="org.apache.catalina.connector.Connector">
				<constructor-arg type="java.lang.String" value="org.apache.coyote.http11.Http11NioProtocol" />	
				<property name="port"><value>${rtmpt.port}</value></property>
				<property name="enableLookups"><value>false</value></property>
			</bean>
		</property>

		<property name="connectionProperties">
			<map>
				<entry key="maxKeepAliveRequests" value="${rtmpt.max_keep_alive_requests}"/>
				<entry key="useExecutor" value="true"/>
				<entry key="maxThreads" value="${rtmpt.max_threads}"/>
				<entry key="acceptorThreadCount" value="${rtmpt.acceptor_thread_count}"/>
				<entry key="processorCache" value="${rtmpt.processor_cache}"/>
			</map>
		</property>
		
		<property name="host">
			<bean class="org.apache.catalina.core.StandardHost">
				<property name="name" value="${rtmpt.host}" />
				<property name="unpackWARs" value="false" />
				<property name="autoDeploy" value="false" />
				<property name="xmlValidation" value="false" />
				<property name="xmlNamespaceAware" value="false" />
			</bean>	   
		</property>		

	</bean>

	
	<!--  
		<bean id="rtmpt.server" class="org.red5.server.net.rtmpt.TomcatRTMPTLoader" init-method="init" autowire="byType">
		<property name="embedded">
		<bean class="org.apache.catalina.startup.Embedded" />
		</property>
		
		<property name="engine">
		<bean class="org.apache.catalina.core.StandardEngine">
		<property name="name" value="rtmptServletHandler" />
		<property name="defaultHost" value="localhost" />
		</bean>	  
		</property>
		
		<property name="connector">
		<bean class="org.apache.catalina.connector.Connector">
		<property name="port"><value>8088</value></property>
		<property name="enableLookups"><value>false</value></property>
		</bean>
		</property>
		
		<property name="host">
		<bean class="org.apache.catalina.core.StandardHost">
		<property name="name" value="localhost" />
		<property name="unpackWARs" value="false" />
		<property name="autoDeploy" value="false" />
		<property name="xmlValidation" value="false" />
		<property name="xmlNamespaceAware" value="false" />
		</bean>	   
		</property>		
		
		<property name="context">
		<map>
		<entry>
		<key><value>name</value></key>
		<value>rtmptContext</value>
		</entry>
		<entry>
		<key><value>path</value></key>
		<value></value>
		</entry>
		<entry>
		<key><value>docBase</value></key>
		<value>/</value>
		</entry>		
		</map>			
		</property>	    
		
		<property name="wrapper">
		<bean class="org.apache.catalina.core.StandardWrapper">
		<property name="servletName" value="RTMPTServlet" />
		<property name="servletClass" value="org.red5.server.net.servlet.RTMPTServlet" />
		</bean>	    
		</property>	    
		
		<property name="mappings">
		<map>
		<entry>
		<key><value>RTMPTServlet</value></key>
		<value>/open/*</value>
		</entry>
		<entry>
		<key><value>RTMPTServlet</value></key>
		<value>/close/*</value>
		</entry>
		<entry>
		<key><value>RTMPTServlet</value></key>
		<value>/send/*</value>
		</entry>
		<entry>
		<key><value>RTMPTServlet</value></key>
		<value>/idle/*</value>
		</entry>		      
		</map>
		</property>
		</bean>
	-->
	
	<!-- RTMPS -->
	<!-- 
	<bean id="rtmps.server" class="org.red5.server.net.rtmps.TomcatRTMPSLoader" init-method="init" lazy-init="true">
	
		<property name="webappFolder" value="${red5.root}/webapps" />
		
		<property name="connector">
			<bean class="org.apache.catalina.connector.Connector">
				<constructor-arg type="java.lang.String" value="org.apache.coyote.http11.Http11NioProtocol" />			
				<property name="port" value="${rtmps.port}" />
				<property name="redirectPort" value="${rtmp.port}" />
			</bean>			
		</property>	
		
		<property name="host">
			<bean class="org.apache.catalina.core.StandardHost">
				<property name="name" value="${rtmps.host}" />
				<property name="unpackWARs" value="false" />
				<property name="autoDeploy" value="false" />
				<property name="xmlValidation" value="false" />
				<property name="xmlNamespaceAware" value="false" />
			</bean>	   
		</property>		
	
		<property name="connectionProperties">
			<map>
				<entry>
					<key><value>SSLEnabled</value></key>
					<value>true</value>
				</entry>
				<entry>
					<key><value>sslProtocol</value></key>
					<value>TLS</value>
				</entry>
				<entry>
					<key><value>clientAuth</value></key>
					<value>false</value>
				</entry>
				<entry>
					<key><value>keystoreFile</value></key>
					<value>conf/keystore</value>
				</entry>
				<entry>
					<key><value>keystorePass</value></key>
					<value>${rtmps.keystorepass}</value>
				</entry>
				<entry>
					<key><value>keystoreType</value></key>
					<value>JKS</value>
				</entry>
			</map>
		</property>	

		<property name="valves">
      		<list>
	    		<bean id="valve.access" class="org.apache.catalina.valves.AccessLogValve">
	                <property name="directory" value="log" />
	                <property name="prefix" value="${rtmps.host}_rtmps_access." />
	                <property name="suffix" value=".log" />
	                <property name="pattern" value="common" />
	                <property name="resolveHosts" value="false" />
	                <property name="rotatable" value="true" />
	        	</bean>
        	</list>
        </property>			
	
	</bean>	 
	-->
</beans>

 
2. 사이드 서버의 주요 구성
 
conf/red5.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:lang="http://www.springframework.org/schema/lang"
       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
                           http://www.springframework.org/schema/lang http://www.springframework.org/schema/lang/spring-lang-2.5.xsd">

	<!-- This file just wires together the context tree. Its accessed by ContextSingletonBeanFactoryLocator -->
	
	<bean id="placeholderConfig"
		class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
		<property name="location" value="classpath:/red5.properties" />
	</bean>

	<!-- First we load the common context, its shared between all the other contexts -->
	<!-- Global context serves are the parent to all child contexts. -->
	<bean id="red5.common"
  	    class="org.springframework.context.support.FileSystemXmlApplicationContext">
    	<constructor-arg><list><value>classpath:/red5-common.xml</value></list></constructor-arg>
	</bean>
	
	<!-- Then we load the core context, with the common as parent --> 
	<!-- Context holding all the networking, users should need to edit. -->
	<bean id="red5.core"
  	    class="org.springframework.context.support.FileSystemXmlApplicationContext">
    	<constructor-arg><list><value>classpath:/red5-edge-core.xml</value></list></constructor-arg>
    	<constructor-arg><ref bean="red5.common" /></constructor-arg>
	</bean>

	<!-- Then we load the global contexts, note its important this happens before app container loads -->
	<bean id="context.loader" 
		class="org.red5.server.ContextLoader"
		init-method="init">
		<property name="parentContext" ref="red5.common" />
		<property name="contextsConfig" value="classpath:red5.globals" />
	</bean>	
</beans>

 
conf/red5-edge-core.xml
<?xml version="1.0" encoding="UTF-8" ?>
<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns:lang="http://www.springframework.org/schema/lang"
	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd                            
	http://www.springframework.org/schema/lang http://www.springframework.org/schema/lang/spring-lang-2.5.xsd">
	<!-- This context holds all the networking: mina -->

	<bean id="customEditorConfigurer"
		class="org.springframework.beans.factory.config.CustomEditorConfigurer">
		<property name="customEditors">
			<map>
				<entry key="java.net.SocketAddress">
					<bean
						class="org.apache.mina.integration.beans.InetSocketAddressEditor" />
				</entry>
			</map>
		</property>
	</bean>
	
	<bean id="placeholderConfig"
		class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
		<property name="location" value="classpath:/red5.properties" />
	</bean>

	<!-- RTMP Handler -->
	<bean id="rtmpHandler"
		class="org.red5.server.net.rtmp.EdgeRTMPHandler">
		<property name="server" ref="red5.server" />
		<property name="statusObjectService" ref="statusObjectService" />
		<property name="MRTMPManager" ref="mrtmpEdgeManager" />
	</bean>
	
	<bean id="rtmpMinaConnManager"
		class="org.red5.server.net.rtmp.RTMPConnManager">
	</bean>
	
	<!-- RTMP Mina IO Handler -->
	<bean id="rtmpMinaIoHandler"
		class="org.red5.server.net.rtmp.EdgeRTMPMinaIoHandler">
		<property name="handler" ref="rtmpHandler" />
		<property name="codecFactory" ref="rtmpCodecFactory" />
		<property name="rtmpConnManager" ref="rtmpMinaConnManager" />
	</bean>
	
	<!-- RTMP Mina Transport -->
	<!-- <bean id="rtmpTransport" class="org.red5.server.net.rtmp.RTMPMinaTransport" init-method="start" destroy-method="stop">
		<property name="ioHandler" ref="rtmpMinaIoHandler" />
		<property name="address" value="${rtmp.host}" />
		<property name="port" value="${rtmp.port}" />
		<property name="receiveBufferSize" value="${rtmp.receive_buffer_size}" />
		<property name="sendBufferSize" value="${rtmp.send_buffer_size}" />
		<property name="eventThreadsCore" value="${rtmp.event_threads_core}" />
		<property name="eventThreadsMax" value="${rtmp.event_threads_max}" />
		<property name="eventThreadsQueue" value="${rtmp.event_threads_queue}" />
		<property name="eventThreadsKeepalive" value="${rtmp.event_threads_keepalive}" /> -->
		<!-- This is the interval at which the sessions are polled for stats. If mina monitoring is not
				enabled, polling will not occur. -->
	<!-- 	<property name="jmxPollInterval" value="1000" />
		<property name="tcpNoDelay" value="${rtmp.tcp_nodelay}" />
	</bean> -->

	<bean id="rtmpTransport" class="org.red5.server.net.rtmp.RTMPMinaTransport" init-method="start" destroy-method="stop">
		<property name="ioHandler" ref="rtmpMinaIoHandler" />
        <property name="connectors">
            <list>
                <bean class="java.net.InetSocketAddress">
                    <constructor-arg index="0" type="java.lang.String" value="${rtmp.host}" />  
                    <constructor-arg index="1" type="int" value="${rtmp.port}" />  
                </bean>
                <!-- You can now add additional ports and ip addresses
                <bean class="java.net.InetSocketAddress">
                    <constructor-arg index="0" type="java.lang.String" value="${rtmp.host}" />  
                    <constructor-arg index="1" type="int" value="1936" />  
                </bean>
                 -->
            </list>
        </property>
		<property name="receiveBufferSize" value="${rtmp.receive_buffer_size}" />
		<property name="sendBufferSize" value="${rtmp.send_buffer_size}" />
		<property name="connectionThreads" value="${rtmp.connect_threads}" />
		<property name="ioThreads" value="${rtmp.io_threads}" />
		<!-- This is the interval at which the sessions are polled for stats. If mina monitoring is not
				enabled, polling will not occur. -->
		<property name="jmxPollInterval" value="1000" />
		<property name="tcpNoDelay" value="${rtmp.tcp_nodelay}" />
	</bean>
	
	<!-- RTMP Mina Connection -->
	<bean id="rtmpEdgeMinaConnection" scope="prototype"
		class="org.red5.server.net.rtmp.EdgeRTMPMinaConnection">
		<!-- Ping clients every X ms. Set to 0 to disable ghost detection code. -->
		<property name="pingInterval" value="${rtmp.ping_interval}" />
		<!-- Disconnect client after X ms of not responding. -->
		<property name="maxInactivity" value="${rtmp.max_inactivity}" />
		<!-- Max. time in milliseconds to wait for a valid handshake. -->
		<property name="maxHandshakeTimeout" value="5000" />
		<property name="mrtmpManager" ref="mrtmpEdgeManager" />
	</bean>
	
	<bean id="mrtmpCodecFactory"
		class="org.red5.server.net.mrtmp.codec.MRTMPCodecFactory" />
	
	<bean id="mrtmpHandler" class="org.red5.server.net.mrtmp.EdgeMRTMPHandler">
		<property name="mrtmpManager" ref="mrtmpEdgeManager"/>
		<property name="codecFactory" ref="mrtmpCodecFactory" />
		<property name="rtmpConnManager" ref="rtmpMinaConnManager" />
	</bean>
	
	<bean id="mrtmpClient"
		class="org.red5.server.net.mrtmp.MRTMPClient" init-method="start" >
		<property name="ioHandler" ref="mrtmpHandler" />
		<property name="server" value="${mrtmp.server}" />
		<property name="port" value="${mrtmp.port}" />
	</bean>
	
	<bean id="mrtmpEdgeManager"
		class="org.red5.server.net.mrtmp.SimpleMRTMPEdgeManager">
		<property name="rtmpConnManager" ref="rtmpMinaConnManager" />
	</bean>
	
	<!-- Enable when you need it.
	<bean id="rtmpProxyTransport" class="org.red5.server.net.rtmp.RTMPMinaTransport" init-method="start" destroy-method="stop">
		<property name="ioHandler" ref="debugProxyIoHandler" />
		<property name="address" value="${proxy.source_host}" />
		<property name="port" value="${proxy.source_port}" />
		<property name="receiveBufferSize" value="${rtmp.receive_buffer_size}" />
		<property name="sendBufferSize" value="${rtmp.send_buffer_size}" />
		<property name="eventThreadsCore" value="${rtmp.event_threads_core}" />
		<property name="eventThreadsMax" value="${rtmp.event_threads_max}" />
		<property name="eventThreadsQueue" value="${rtmp.event_threads_queue}" />
		<property name="eventThreadsKeepalive" value="${rtmp.event_threads_keepalive}" />
	</bean>
    
	<bean id="debugProxyIoHandler"
		class="org.red5.server.net.proxy.DebugProxyHandler">
		<property name="codecFactory" ref="rtmpCodecFactory" />
		<property name="forward" value="${proxy.destination_host}:${proxy.destination_port}" />
		<property name="dumpTo" value="./webapps/dump/" />
	</bean>
	-->
</beans>

좋은 웹페이지 즐겨찾기