Connecting to TCP server from flash socket on local environment

I have made a swf file for distribution version to clients to use on their computer.
and I have a TCP server connected from that swf file.
before testing it, I have read some articles related to policy file on adobe website

I tried to test that, and have used the nodejs and swf file for that
but I failed. here is how it looks like.

crossdomain.xml on root tcp_server.js var sys = require("sys"), net = require("net"); var server = net.createServer(function(stream) { stream.addListener("connect", function() { sys.puts("Client connected"); stream.write("hello\r\n"); }); stream.addListener("data", function(data) { sys.puts("Received from client: " + data); stream.write(data); }); stream.addListener("end", function() { sys.puts("Client disconnected"); stream.write("goodbye\r\n"); stream.end(); }); }); server.listen(3000, "localhost"); swf file on local import flash.net.Socket; var socket:Socket = new Socket(); trace(socket); trace("a socket is created"); socket.connect("localhost", 3000); It seems like a long code, anyway

I tested it, and got this error

for wrong code, the policy file at xmlsocket://localhost:843 will be ignored

I can't find what is wrong with my code,
If you know that, Please let me know
Thanks for who reads this question

Have a nice day.
where is the rest of the as3 code?

以上就是Connecting to TCP server from flash socket on local environment的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » Node.js答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准

联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏