推荐学习书目
› Learn Python the Hard Way
Python Sites
› PyPI - Python Package Index
› http://diveintopython.org/toc/index.html
› Pocoo
值得关注的项目
› PyPy
› Celery
› Jinja2
› Read the Docs
› gevent
› pyenv
› virtualenv
› Stackless Python
› Beautiful Soup
› 结巴中文分词
› Green Unicorn
› Sentry
› Shovel
› Pyflakes
› pytest
Python 编程
› pep8 Checker
Styles
› PEP 8
› Google Python Style Guide
› Code Style from The Hitchhiker's Guide
jianzhichao
V2EX  ›  Python

我想通过 tornado websocket 实现一个 一对一的聊天室

  •  
  •   jianzhichao · Dec 17, 2014 · 6141 views
    This topic created in 4310 days ago, the information mentioned may be changed or developed.
    但是我对websocket的工作状态很是费解,在 网上找了一堆这方面的资料 看的 还是模模糊糊的,只知道首先是握手建立连接,但是前端为什么要用js 来握手呢?(不了解大部分资料都是用js)。谁能给我一个清晰 简单的例子啊,比如我更改什么地方 能够建立连接,更改什么地方能够向服务器发送消息,前端发送之后 后端如何接收,,然后后端如何向前端发送数据,之类的。谢谢大神啊。实在没办法了 才来救助的。
    2 replies  •  2014-12-19 20:30:48 +08:00
    zenliver
        1
    zenliver  
       Dec 17, 2014
    先看一下websocket协议,,,然后,,,不想用js, browser如果还支持其他脚本语言, 应该也是可以用的, 似乎没见过, 然后,,,tornado自己有个demo, 可以参考(对于大多数人来说, 协议细节不需要知道, 知道怎么用就行了)
    laike9m
        2
    laike9m  
       Dec 19, 2014
    前端 socket.io,后端就用 tornado 的 websocket,这样是可以的
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   752 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 21:17 · PVG 05:17 · LAX 14:17 · JFK 17:17
    ♥ Do have faith in what you're doing.