xcm153
V2EX  ›  问与答

怎样实现 socket.io 的客户端??????

  •  
  •   xcm153 · Jan 23, 2017 · 3584 views
    This topic created in 3487 days ago, the information mentioned may be changed or developed.

    我用 socket.io 写了个聊天程序,之后我希望通过脚本来自动发送信息,在网上得知 python 的 websocket-client,抓包时是如下结果 img websocket-client 构造时需要 ws 网址,我试了很多都不起作用

    socket.io 是否可以 websocket-client 来发送信息?还是必须自己写一个 ws 服务器?

    或者有什么其他的方法来发送信息吗?

    多谢各位指点

    5 replies    2017-01-23 13:14:44 +08:00
    chairuosen
        1
    chairuosen  
       Jan 23, 2017
    你涂抹的那行不是就 server 端地址么
    内容协议可以看旁边那个 frames 标签
    hustfox
        2
    hustfox  
       Jan 23, 2017
    Socket.io 自带 Socket 和 WebSocket 吧
    zhouyg
        3
    zhouyg  
       Jan 23, 2017
    Socket.io 自带客户端
    gamexg
        4
    gamexg  
       Jan 23, 2017
    以前找的,我用的是
    https://github.com/ziyasal/socket.io-python-emitter

    看到 python 与 socket.io 之间通信有

    https://github.com/ziyasal/socket.io-python-emitter
    使用官方的接口,但是需要 redis ,不想为了通信而在运行一个 redis 了。

    https://github.com/invisibleroads/socketIO-client
    socket.io python 客户端库 更新日期也不晚,看接口比较适合我这种轻度使用的情况。

    https://github.com/evanw/socket.io-python
    socket.io 的服务器库,是通过启动一个 nodejs socket.io 然后与 python tcp 通信实现的,最后更新日期 4 年前...

    https://github.com/abourget/gevent-socketio
    python gevent 实现的 socket.io 客户端,最后更新日期 2014 年 2 月,很想用这个,但是怕碰到兼容问题。

    https://github.com/nkzawa/socket.io-client.java
    socket.io java 客户端库, android 上面用正好。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3165 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 12:23 · PVG 20:23 · LAX 05:23 · JFK 08:23
    ♥ Do have faith in what you're doing.