English 中文(简体)
5. 待决和未工作的小队
原标题:flashsocket on socketio and nodejs not working

我试图用袖珍材料收集闪电。 io,但并不总是在幼.污染中发生。

我看不出,如果任何人能够帮助,我会错做什么。

www.un.org/spanish/ecosoc 在服务器边:

var app = express.createServer(),
io = require( socket.io ).listen(app, {
    flashPolicyServer: true,
    transports: [ flashsocket ,  htmlfile ,  xhr-polling ,  jsonp-polling ]
});
app.listen(80);

www.un.org/spanish/ecosoc 在客户方面:

...
<script src="/socket.io/socket.io.js"></script>
...
            socket = io.connect();

            socket.on( connect , function(evt) {
                console.log(socket.socket.transport.name);

                onOpen(timeDifference(new Date(), earlierDate), socket.socket.transport.name);
                earlierDate = new Date();
                socket.on( disconnect , function(evt) {
                    onClose(evt);
                });
                socket.on( echo , function(msg) {
                    onEcho(msg);
                });
                socket.on( error , function(evt) {
                    onError(evt);
                });
            });

After that I checked that my browser chrome has flash enabled. I also checked that port 843 and 10843 are listening and responding :

<cross-domain-policy>
    <allow-access-from domain="*" to-ports="*"/>
</cross-domain-policy>

在服务器记录上,只有:

debug - served static content /socket.io.js
debug - client authorized
info  - handshake authorized 14328044138726156
debug - setting request GET /socket.io/1/xhr-polling/14328044138726156?t=1333755740295
debug - setting poll timeout
debug - client authorized for 
debug - clearing poll timeout
debug - xhr-polling writing 1::
debug - set close timeout for client 14328044138726156
debug - setting request GET /socket.io/1/xhr-polling/14328044138726156?t=1333755740299
debug - setting poll timeout
debug - clearing poll timeout
debug - xhr-polling writing 5:::{"name":"echo","args":["transport type : xhr-polling; and socket.id : 14328044138726156"]}
debug - set close timeout for client 14328044138726156
debug - discarding transport
debug - cleared close timeout for client 14328044138726156
debug - setting request GET /socket.io/1/xhr-polling/14328044138726156?t=1333755740303
debug - setting poll timeout
debug - discarding transport
debug - cleared close timeout for client 14328044138726156
debug - clearing poll timeout
debug - xhr-polling writing 8::
debug - set close timeout for client 14328044138726156`

感谢你们的帮助

最佳回答

事实上,它发挥了作用!

Thanks to XHR, you lead me to more analyze and test so I could found by myself.

It works, but different as expected : When websocket is enabled on a browser, you cannot use flashsocket instead.

So even if you setup the server with : transports: [ flashsocket , htmlfile , xhr-polling , jsonp-polling ] your google chrome will never use flashsocket because it has websocket enabled and it falls back to xhr-polling. But Internet explorer which doesn t have websocket enabled will use flashsocket.

而且,我没有必要编定袖珍。 如果没有网状,这种行为对我有利。

而且 我认为,这一行为是空洞的,因为它防止在你不需要时装上沉重的卷宗。

Jerome。

问题回答

暂无回答




相关问题
Disable button tooltip in AS3

I want to disable the tooltip on certain buttons. The tooltip manager seems to be an all or nothing solution. Is it possible to disable the tooltip for just one or two buttons?

Sorting twodimensional Array in AS3

So, i have a two-dimensional Array of ID s and vote count - voteArray[i][0] = ID, voteArray[i][1] = vote count I want the top 3 voted items to be displayed in different colors, so i have a 2nd Array -...

Virtual Tour using sketch up, ajax, flash technologies

I want to know if there are existing technology that make your 3d models in sketch into virtual tours, using either Ajax or Flash for web presentation. If there s none, which will be a good approach ...

AS3 try/catch out of memory

I m loading a few huge images on my flex/as3 app, but I can t manage to catch the error when the flash player runs out of memory. Here is the what I was thinking might work (I use ???? because i dont ...

Red5 Security Tutorial

I am looking for a step by step tutorial on securing Red5 from intrusion. This seems to be a question that comes up alot in a google search, but is never really answered in a way that makes sense to ...

Clipboard access using Javascript - sans Flash?

Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...

visible property of DisplayObject

For example I have a hierarchy of movie clips. mc1 is a child of mc, and mc2 is a child of mc1. Turns out that when I set mc1.visible = false; mc2.visible stays true. Is that supposed to happen?...

热门标签