代码之家  ›  专栏  ›  技术社区  ›  Lukas

插座.IO/ 节点.JS/轨道3/IE

  •  3
  • Lukas  · 技术社区  · 16 年前

    这有点复杂,但还是这样。

    Kthxbye

    然而,Firefox和IE必须默认使用其他解决方案,因为它们还不支持WebSockets。

    目前看来,两者都默认为xhr轮询传输。从节点.js日志。一切都很好。但是,在IE上,传输/轮询方法似乎有错误。从节点.js日志:

    29 Sep 15:30:02 - Initializing client with transport "xhr-polling"
    29 Sep 15:30:02 - Client 9219092682469636 connected
    29 Sep 15:30:05 - Client 8440734834875911 disconnected
    29 Sep 15:30:05 - Client 6149627515114844 disconnected
    29 Sep 15:30:07 - Illegal transport "jsonp-polling"
    29 Sep 15:30:07 - Illegal transport "jsonp-polling"
    

    所以它看起来就像是在连接,一旦它试图投票,它就会因为“非法传输”问题而断开连接。有人知道那是从哪里来的吗?

    还有一些线索,flashconnector似乎加载正确,但我假设它没有运行或无法加载,因为它仍然返回到xhr轮询。从IE中,我可以看到每个轮询周期都会发出以下3个请求:

    GET /socket.io/xhr-polling//1285789236601 HTTP/1.1
    Accept: */*
    Origin: http://plukevdh-desktop:3000
    Accept-Language: en-us
    Accept-Encoding: gzip, deflate
    User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; OfficeLiveConnector.1.4; OfficeLivePatch.1.3)
    Host: itwebpriv1:8081
    Connection: Keep-Alive
    Cache-Control: no-cache
    
    HTTP/1.1 200 OK
    Content-Type: text/plain
    Content-Length: 25
    Access-Control-Allow-Origin: undefined
    Connection: keep-alive
    
    ---
    
    GET /socket.io/xhr-polling//1285789236616 HTTP/1.1
    Accept: */*
    Origin: http://plukevdh-desktop:3000
    Accept-Language: en-us
    Accept-Encoding: gzip, deflate
    User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; OfficeLiveConnector.1.4; OfficeLivePatch.1.3)
    Host: itwebpriv1:8081
    Connection: Keep-Alive
    Cache-Control: no-cache
    
    HTTP/1.1 200 OK
    Content-Type: text/plain
    Content-Length: 24
    Access-Control-Allow-Origin: undefined
    Connection: keep-alive
    
    ---
    
    GET /socket.io/jsonp-polling//1285789241616/0 HTTP/1.1
    Accept: */*
    Referer: http://plukevdh-desktop:3000/jobs/905390
    Accept-Language: en-us
    User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; OfficeLiveConnector.1.4; OfficeLivePatch.1.3)
    Accept-Encoding: gzip, deflate
    Host: itwebpriv1:8081
    Connection: Keep-Alive
    
    1 回复  |  直到 16 年前
        1
  •  1
  •   mrbrdo Tomdarkness    16 年前

    我觉得你有一个旧版本的插座.IO还没有jsonp轮询支持的服务器。以及更新的客户端版本。。。无论如何,根据我的经验,自动取款机不能很好地工作,所以不用费心了。在IE中,flashsocket应该可以工作,xhr轮询也应该可以工作,除非ofc您正在另一个域(而不是您的网站)上运行S.IO服务器。如果您使用的是其他端口,那么xhr轮询在Opera中不起作用,但应该可以在其他浏览器中使用。

    推荐文章