惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

C
Cisco Blogs
爱范儿
爱范儿
有赞技术团队
有赞技术团队
博客园 - 【当耐特】
Jina AI
Jina AI
Project Zero
Project Zero
宝玉的分享
宝玉的分享
Martin Fowler
Martin Fowler
WordPress大学
WordPress大学
Simon Willison's Weblog
Simon Willison's Weblog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
T
Tenable Blog
F
Fortinet All Blogs
大猫的无限游戏
大猫的无限游戏
Last Week in AI
Last Week in AI
月光博客
月光博客
雷峰网
雷峰网
G
Google Developers Blog
V
V2EX
T
Tor Project blog
罗磊的独立博客
Schneier on Security
Schneier on Security
Know Your Adversary
Know Your Adversary
W
WeLiveSecurity
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
P
Privacy International News Feed
S
Securelist
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
P
Proofpoint News Feed
Blog — PlanetScale
Blog — PlanetScale
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
小众软件
小众软件
Scott Helme
Scott Helme
I
Intezer
T
Threat Research - Cisco Blogs
The GitHub Blog
The GitHub Blog
N
Netflix TechBlog - Medium
C
CERT Recently Published Vulnerability Notes
Security Archives - TechRepublic
Security Archives - TechRepublic
酷 壳 – CoolShell
酷 壳 – CoolShell
L
LINUX DO - 最新话题
N
News | PayPal Newsroom
L
Lohrmann on Cybersecurity
T
Troy Hunt's Blog
Google DeepMind News
Google DeepMind News
P
Proofpoint News Feed
人人都是产品经理
人人都是产品经理
Latest news
Latest news
AWS News Blog
AWS News Blog
Apple Machine Learning Research
Apple Machine Learning Research

博客园 - 火腿骑士

webstorm+nodejs+express配置 树莓派raspberry pi配置无线路由器AP 树莓派raspberry pi配置 html5使用canvas实现毫秒级画心电图 html5使用canvas动态画医学设备毫秒级数据波形图 IntelliJ IDEA web项目 工程构建运行部署 H5调用本地摄像头[转] [转]把树莓派配置成无线路由器 [转]Raspberry Pi做成路由器 Linux 升级 Python 至 3.x 防抖(Debounce)与节流( throttle)区别 spring mvc 实战化项目之三板斧 vue开发资料 asp.net mvc 实战化项目之三板斧 [转]gulp构建前端工程 gulp前端自动化构建工具使用 laravel实战化项目之三板斧 免费网络视频监控软件cmsclient awesomes前端资源库网站
websocket for python
火腿骑士 · 2016-12-15 · via 博客园 - 火腿骑士
https://github.com/aaugustin/websockets

server.py

#!/usr/bin/env python

import asyncio
import websockets

async def send(websocket, path):
while True:
if not websocket.open:
return
name = await websocket.recv()
await websocket.send("{}".format(name))
print("{}".format("{}".format(name)))

start_server = websockets.serve(send, '192.168.2.150', 8765)
asyncio.get_event_loop().run_until_complete(start_server)
asyncio.get_event_loop().run_forever()