Define transport types on the client side

前端 未结 2 698
自闭症患者
自闭症患者 2020-12-29 11:56

I need to use jsonp-polling for IE, and xhr-polling for Firefox, so I tried to define types of transports on the client side like this:

    if (/Firefox[\\         


        
2条回答
  •  感情败类
    2020-12-29 12:36

    The bug is now fixed in socket.io version 0.9.6, I can use this and it works fine :

    socket = io.connect(HOST_REMOTE, {
        transports: ['xhr-polling']
    });
    

    In version 1.0.0 and above:

    socket = io.connect(HOST_REMOTE, {
        transports: ['polling']
    });
    

提交回复
热议问题