摘要: 长轮询 轮询,在前端通过写js实现。缺点:有延迟、服务器压力大。 urls.py from django.conf.urls import url from django.contrib import admin from app01 import views urlpatterns = [ url 阅读全文
posted @ 2019-11-29 15:05 阿浪阿浪 阅读(303) 评论(0) 推荐(0) 编辑
摘要: 1. websocket 2. 原理 客户端向服务端发送随机字符串,在http的请求头中 服务端接受到到随机字符串 随机字符串 + 魔法字符串 sha1加密 base64加密 放在响应头中给用户返回 客户端浏览器会进行校验,校验不通过:服务端不支持websocket协议。 客户端和服务端进行相互收发 阅读全文
posted @ 2019-11-29 15:04 阿浪阿浪 阅读(255) 评论(0) 推荐(0) 编辑