我已经在 PHP 中创建了一个基本的 flash 套接字服务器,它在我的本地机器上都可以正常工作(在浏览器和 flash 沙箱中)但是一旦我让另一台机器连接到我的计算机的站点目录,他们就不能获得与服务器的连接!
闪现:
mySocket.connect("localhost",9999);
在 PHP 中
$address = '127.0.0.1';
$port = 9999;
我尝试将闪存代码更改为我机器的 IP,但是没有一个客户端(包括本地客户端)可以连接。
请帮忙!
PS. Running on a mac in the Sites dir. I am running the socket server through terminal (PHP 5). Am running a policy file server with perl but I don't think that is the problem
最佳答案
“127.0.0.1”是环回接口(interface)的地址。它只能在同一台机器上使用。您需要通过将套接字绑定(bind)到“0.0.0.0”来监听所有接口(interface)(环回、eth0 等)。
关于php - Flash 套接字服务器仅适用于本地计算机,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1698029/