Red5 从远程客户端连接时出现问题

发布于 2024-11-01 21:06:35 字数 641 浏览 1 评论 0原文

所以我有这个问题。问题是我无法从远程客户端连接到我的 red5 服务器。我还没有找到任何关于如何安装 red5 以便远程客户端可以连接到它的教程。然而,这就是我所做的...

在我的 MXML Flex 文件中,我尝试连接到服务器正在运行的计算机 IP(我的服务器在 Eclipse 中运行)。连接线看起来像这样 netConnection.connect(rtmp://192.168.2.12/myApp, true); 所有发生的事情都是在几分钟后,我刚刚得到 NetConnection.Connect.Failed 并且 Eclipse 没有输出任何日志。几乎就像它从未注册远程客户端尝试建立的连接一样。

另一件有趣的事情是,我能够使用本地家庭网络中的另一台计算机连接到我的 Red5 服务器。但只有在远程时我才无法连接。

我已经更改了 Red5-web.properties 文件并添加了此... webapp.contextPath=/myApp webapp.virtualHosts = *,127.0.0.1,本地主机,192.168.2.14,174.122.104.3 174 是我的 Flex Swf 所在的网站。

我想也许我的计算机没有设置或配置为允许这些远程连接并拒绝它们或其他什么,我不太确定为什么远程客户端无法连接。有人有 ida 吗?

非常感谢您的帮助。

So I have this issue. The issue is I am unable to connect to my red5 server from a remote client. I also have not found any tutorials on how to install red5 so that remote clients can connect to it. However, here is what I have done...

Inside My MXML Flex File I try to connect to the computers IP that the server is running on(My Server is running from within Eclipse). The line for connecting looks like this netConnection.connect(rtmp://192.168.2.12/myApp, true);
All that happens is after a lot of minutes go by, I just get NetConnection.Connect.Failed and there is no log being output by Eclipse. Almost like it never even registers the connection that the remote client is trying to make.

The other interesting thing is that I am ABLE to connect to my Red5 Server using a different computer within my local home network just fine. But only when it is remote I am unable to connect.

I have changed my Red5-web.properties file and added this...
webapp.contextPath=/myApp
webapp.virtualHosts=*, 127.0.0.1, localhost, 192.168.2.14, 174.122.104.3
The 174 one is my website where the Flex Swf Resides on.

I think maybe somehow my computer is not setup or configured to allow these remote connections and is rejecting them or something, I'm not quite sure why a remote client can't connect. Does anyone have any idas?

Your help is greatly appreciated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

沙沙粒小 2024-11-08 21:06:35

您可以卸载red5并重新安装。

当它询问您服务器 IP 地址时,请输入服务器的 LAN 地址(192.168.2.*10.0.0.* 等)。这解决了我的问题。

You may uninstall the red5 and reinstall it.

When it ask you the server ip address type your server's LAN adress (192.168.2.* or 10.0.0.* whatever). This solved my problem.

祁梦 2024-11-08 21:06:35

在我看来,如果您至少拥有一个域名,那么最好的方法是设置一个 Apache Http Server 连接到您的服务器计算机,并为 red5、rtmp 和 rtmpt 创建子域。让 Apache 处理您传入的请求,并决定它们的正确路由。

如果您没有域名,或者之前的方法设置和运行起来太耗时,您应该确保您尝试连接的 IP 地址不是内部 IP。

在上面的示例中,您尝试从客户端连接到 192.168... 地址。如果您尝试从 LAN 内连接到它,它会起作用,因为该 IP 已注册到您的计算机。
但是,当您将笔记本带到邻居处,并使用他的互联网连接访问您的站点并连接到 red5 时,客户端(flex 应用程序)也会尝试连接到该 192.168...,并且你邻居的路由器不知道你的局域网,可能它也没有这样的内部IP地址,但肯定无法连接到你的服务器。

因此,您应该尝试使用外部 IP 地址(174...),而不是在连接字符串中使用 192.168...

netConnection.connect("rtmp://174.122.104.3/myApp", true);

这将始终有效,因为只要你有一个静态IP地址。

还要确保您的 red5 服务器可以通过 80 端口访问,如果不能,请指定正确的端口号。

In my opinion, if you have at least one domain name that you own, the best way for you to go is to set up an Apache Http Server to your server machine, and create subdomains for both red5, rtmp and rtmpt. Make the Apache handle your incoming requests, and decide their correct routing there.

In case you don't own a domain, or the previous way is too time-taking to set up and get it work, you should just make sure that the ip address you're trying to connect to is not an internal IP.

In your example above you are trying to connect from the client to a 192.168... address. If you try to connect to it from within your LAN, it works, since that ip there is registered to your machine.
But when you take your notebook to your neighbor, and using his internet connection to access your site and connect to red5, the client (flex application) will also try to connect to that 192.168..., and your neighbor's router has no idea about your LAN, probably it doesn't have such an internal IP address either, but SURELY cannot connect to your server.

So instead of using 192.168... in your connection string, you should try using your external IP address (the 174... one):

netConnection.connect("rtmp://174.122.104.3/myApp", true);

This will work always, as far as you have a static IP address.

Also make sure, that your red5 server is accessible over the 80 port, or if it's not, specify the correct port number there.

一杯敬自由 2024-11-08 21:06:35

为此你可以做以下事情......
我采取的这些步骤解决了我的问题...

1.During the installation, you must have given ip 127.0.0.1 (localhost) and port :5080
2.firstly open the port (5080 and  1935) on firewall. 

访问 http://windows.microsoft.com/en-in/windows/open-port-windows-firewall#1TC=windows-7

3.Now to go red5->conf->red5.properties and open this file in notepad++. (or any other editor)
4.repalce http.host and rtmp.host ip with your ip address (ipv4)
5.start the red5 service.
6.Now check http://yourip:5080

它将开始工作,您可以从其他系统访问它也(显然在同一网络中)

For that you can do following thing...
These steps I took and it's solved my problem...

1.During the installation, you must have given ip 127.0.0.1 (localhost) and port :5080
2.firstly open the port (5080 and  1935) on firewall. 

Visit http://windows.microsoft.com/en-in/windows/open-port-windows-firewall#1TC=windows-7

3.Now to go red5->conf->red5.properties and open this file in notepad++. (or any other editor)
4.repalce http.host and rtmp.host ip with your ip address (ipv4)
5.start the red5 service.
6.Now check http://yourip:5080

It will start working, and you can access it from other system also (in the same network Obviously )

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文