django - 带有 Django channel 的网络套接字

标签 django python-3.x ssl websocket django-channels

我正在写一个电子投票的小原型(prototype),每个人都会投票,但投票将通过 Shamir 的 secret 共享进行加密,因此投票结果只有在所有选民见面时才会显示。我不知道这是否可行但为此我想将 django-channel 集成到我现有的项目中以在用户之间创建实时通信并等待所有选民登录并输入他们的密码之一(以解密 key 号码)在数据库中)并有效地在临时卷轴上显示结果(我从不使用 Django-channel)。

所以我的问题是:

这可能吗?我可以在我的本地主机上运行 WSS(websocket secure)吗?如果可以,如何运行?

最佳答案

我认为您正在寻找 daphne .

Daphne is a HTTP, HTTP2 and WebSocket protocol server for ASGI and ASGI-HTTP, developed to power Django Channels.

也就是说,如果只是为了演示,您可能可以通过 JavaScript 轮询您的服务器。

关于django - 带有 Django channel 的网络套接字,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56811850/

相关文章:

Django用count过滤多对多关系

Django FlatPages 与 Django-CMS

python - 升级时出现模糊编码 WSGI 错误 : "write() argument must be a bytes instance"

python - mxnet(胶子): cpu used when gpu(0) context selected

php - 登录和结帐页面需要 SSL 的 Magento index.php [HTTP 404]

python - 内存中图像到 Zip 文件

python - 在python中创建matlab平均滤波器

python - 基于多列的唯一值

javax.net.ssl.SSLKeyException : [Security:090477]Certificate chain received from intranet. xxx.com

java - 代码签名证书 Java