geew
V2EX  ›  问与答

最近想研究下 websocket, 想问问几个问题

  •  
  •   geew · Jun 12, 2014 · 3273 views
    This topic created in 4537 days ago, the information mentioned may be changed or developed.
    1. 原生的WebSocket对象和包装的socket.io哪个要好些(性能以及易用方面)呢?
    2. engine.io 和socket.io呢?
    5 replies  •  2014-06-12 14:46:04 +08:00
    iwege
    iwege
    Jun 12, 2014
    1
    1. socket.io
    2. socket.io : 1.0 is right around the corner, which features our next-generation realtime core, Engine.IO.

    https://groups.google.com/forum/#!topic/socket_io/BudZpQiyMbQ
    iwege
    iwege
    Jun 12, 2014❤️1
    2
    关于第二个问题,还可以看看socket.io的依赖。

    https://github.com/Automattic/socket.io/blob/master/package.json

    "dependencies": {
    "engine.io": "1.2.2",
    ...
    }

    所以实际上使用socket.io就好了。socket.io主要是兼容性好。没有websocket也有其他的fallback
    geew
    geew
    OP
    Jun 12, 2014
    3
    @iwege 感谢
    yyfearth
    yyfearth
    Jun 12, 2014
    4
    原生的WebSocket有不同标准版本问题 必须用一些封装的库
    socket.io engine.io 是同一帮人写的 貌似新版本 socket.io 的核心就是 engine.io
    另外他们还有 websocket.io 是纯 websocket
    此外还有 sock.js 也是和 socket.io 差不多的东西
    skybr
    skybr
    Jun 12, 2014
    5
    engine.io和sockjs注重的是兼容浏览器的前后端实现.

    socket.io专注的是包括验证、rooms、broadcast接口和实现在内的业务.
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   4360 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 38ms · UTC 08:00 · PVG 16:00 · LAX 00:00 · JFK 03:00
    ♥ Do have faith in what you're doing.