Red5 v0.8
我正在尝试通过端口80隧道传输red5,因为我的应用程序无法在某些设置上运行。
首先,当我进行red5连接时,我尝试在域名后面加上“:80”。这导致了新的NetConnection.Connect.Closed
错误。
然后我撤消了这些更改,然后尝试关注this guide I found,在实施更改后,我得到了同样的错误。
那么我做错了什么/我还需要做什么?
另外,我应该为您提供哪些代码/配置文件?
编辑:
所以我查看了Red5日志,似乎我得到了这个
2013-06-14 05:04:53,330 [main] ERROR o.a.coyote.http11.Http11Protocol - Error initializing endpoint
java.net.BindException: Address already in use<null>:80
完整的错误消息如下。
我做了'netstat -nlp',看到'nginx'在端口80上,所以这可能是个问题。
然后再说'nginx'是一个http服务器,所以将http移离http
没有多大意义我在指南中引用的web.xml包含:
<servlet>
<servlet-name>rtmpt</servlet-name>
<servlet-class>org.red5.server.net.rtmpt.RTMPTServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>rtmpt</servlet-name>
<url-pattern>/fcs/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>rtmpt</servlet-name>
<url-pattern>/open/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>rtmpt</servlet-name>
<url-pattern>/close/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>rtmpt</servlet-name>
<url-pattern>/send/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>rtmpt</servlet-name>
<url-pattern>/idle/*</url-pattern>
</servlet-mapping>
在red5 / conf / red5.properties中,我有以下内容:
# HTTP
http.host=0.0.0.0
http.port=80
https.port=8443
来自日志的错误消息
java.net.BindException: Address already in use<null>:80
at org.apache.tomcat.util.net.JIoEndpoint.init(JIoEndpoint.java:502) [tomcat-coyote-6.0.18.jar:na]
at org.apache.coyote.http11.Http11Protocol.init(Http11Protocol.java:176) [tomcat-coyote-6.0.18.jar:na]
at org.apache.catalina.connector.Connector.initialize(Connector.java:1058) [catalina-6.0.18.jar:na]
at org.apache.catalina.startup.Embedded.start(Embedded.java:830) [catalina-6.0.18.jar:na]
at org.red5.server.tomcat.TomcatLoader.init(TomcatLoader.java:430) [red5.jar:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [na:1.6.0_27]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [na:1.6.0_27]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [na:1.6.0_27]
at java.lang.reflect.Method.invoke(Method.java:616) [na:1.6.0_27]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1414) [spring-beans-2.5.6.jar:2.5.6]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1375) [spring-beans-2.5.6.jar:2.5.6]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1335) [spring-beans-2.5.6.jar:2.5.6]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473) [spring-beans-2.5.6.jar:2.5.6]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409) [spring-beans-2.5.6.jar:2.5.6]
at java.security.AccessController.doPrivileged(Native Method) [na:1.6.0_27]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380) [spring-beans-2.5.6.jar:2.5.6]
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264) [spring-beans-2.5.6.jar:2.5.6]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) [spring-beans-2.5.6.jar:2.5.6]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261) [spring-beans-2.5.6.jar:2.5.6]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185) [spring-beans-2.5.6.jar:2.5.6]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164) [spring-beans-2.5.6.jar:2.5.6]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429) [spring-beans-2.5.6.jar:2.5.6]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728) [spring-context-2.5.6.jar:2.5.6]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380) [spring-context-2.5.6.jar:2.5.6]
at org.red5.server.Launcher.launch(Launcher.java:60) [red5.jar:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [na:1.6.0_27]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [na:1.6.0_27]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [na:1.6.0_27]
at java.lang.reflect.Method.invoke(Method.java:616) [na:1.6.0_27]
at org.red5.server.Bootstrap.bootStrap(Bootstrap.java:106) [boot.jar:na]
at org.red5.server.Bootstrap.main(Bootstrap.java:50) [boot.jar:na]
答案 0 :(得分:2)
你不能让red5服务器和http服务器同时监听端口80。要使用RTMPT,您可以使用代理服务器将open / send / fsc / idle等请求重定向到本地red5服务器,例如:端口5080.这是我在apache web服务器中使用的配置:
ProxyPass /open http://localhost:5080/open
ProxyPassReverse /open http://localhost:5080/open
ProxyPass /send http://localhost:5080/send
ProxyPassReverse /send http://localhost:5080/send
ProxyPass /idle http://localhost:5080/idle
ProxyPassReverse /idle http://localhost:5080/idle
ProxyPass /close http://localhost:5080/close
ProxyPassReverse /close http://localhost:5080/close
ProxyPass /fcs http://localhost:5080/fcs
ProxyPassReverse /fcs http://localhost:5080/fcs
让red5服务器侦听默认端口5080:
# HTTP
http.host=0.0.0.0
http.port=5080
https.port=5443
但当然,如果您愿意,可以使用任何其他未使用的端口。