2

红5 v0.8

我正在尝试通过端口 80 连接 red5,因为我的应用程序不适用于某些设置。

起初,当我建立 red5 连接时,我尝试在域名后面加上“:80”。这导致了一个新的NetConnection.Connect.Closed错误。

然后我撤销了这些更改,然后尝试按照我找到的本指南进行操作,在实施更改后,我得到了同样的错误。

那么我做错了什么/我还需要做什么?

另外,我应该为您提供哪些代码/配置文件?

编辑:

所以我查看了 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]
4

1 回答 1

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

但当然,如果您愿意,您可以使用任何其他未使用的端口。

于 2013-06-14T08:56:37.757 回答