Posted on

Error: probe transport websocket failed

參考文章 1.x: use WebSockets only?




  • pingTimeout (Number): how many ms without a pong packet to
    consider the connection closed (5000)
  • pingInterval (Number): how many ms before sending a new ping
    packet (25000)
  • upgradeTimeout (Number): how many ms before an uncompleted transport upgrade is cancelled (10000)
  • maxHttpBufferSize (Number): how many bytes or characters a message
    can be, before closing the session (to avoid DoS). Default
    value is 10E7.
  • allowRequest (Function): A function that receives a given handshake
    or upgrade request as its first parameter, and can decide whether to
    continue or not. The second argument is a function that needs to be
    called with the decided information: fn(err, success), where
    success is a boolean value where false means that the request is
    rejected, and err is an error code.
  • transports (<Array> String): transports to allow connections
    to (['polling', 'websocket'])
  • allowUpgrades (Boolean): whether to allow transport upgrades
  • perMessageDeflate (Object|Boolean): parameters of the WebSocket permessage-deflate extension
    (see ws module api docs). Set to false to disable. (true)

    • threshold (Number): data is compressed only if the byte size is above this value (1024)
  • httpCompression (Object|Boolean): parameters of the http compression for the polling transports
    (see zlib api docs). Set to false to disable. (true)

    • threshold (Number): data is compressed only if the byte size is above this value (1024)
  • cookie (Object|Boolean): configuration of the cookie that
    contains the client sid to send as part of handshake response
    headers. This cookie might be used for sticky-session. Defaults to not sending any cookie (false).
    See here for all supported options.
  • wsEngine (String): what WebSocket server implementation to use. Specified module must conform to the ws interface (see ws module api docs). Default value is ws. An alternative c++ addon is also available by installing uws module.
  • cors (Object): the options that will be forwarded to the cors module. See there for all available options. Defaults to no CORS allowed.
  • initialPacket (Object): an optional packet which will be concatenated to the handshake packet emitted by Engine.IO.




probe transport "websocket" failed because of error: Error: websocket error



_ioManager = new io.Manager(, {
        reconnection: false,
        reconnectionAttempts: 5,
        reconnectionDelay: 1000,
        extraHeaders: {


_ioManager.opts.transportOptions = {
            polling: {
                extraHeaders: {
                    'Cookie': cookies,