3
私が文字コードsslをインストールするまで、Django-channels websocketはAWSサーバー上で正常に動作していました。別の証明書を試しましたが、wssが機能していません。私はここにandrewgodwin sugestionsを追っdjangoチャンネルの後ろにhttps
https://django-channels-example.herokuapp.com/
:
daphne -b 0.0.0.0 vp.asgi:channel_layer --port 8000 -v 2
:
https://github.com/django/channels/issues/248
私はポート8000へジンチョウゲを指摘し、私はチャンネルがhttpsを背後に働くことができることを示し、このオンライン展開を見ました
そして、私はjavascriptで同じポートを使用しました:
chatsock = new WebSocket(ws_scheme + '://' + window.location.host + ":8000/chat");
私のnginxの設定ファイル://example.com:8000 /チャット
Firefoxは、WSSのサーバーへの接続を確立することはできません。
server {
listen 80;
server_name mysite.com www.example.com;
return 301 https://www.example.com$request_uri;
}
server{
listen 443 ssl;
server_name mysite.com www.example.com;
ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;
root /home/ubuntu/vp;
access_log /var/log/nginx/guni-access.log;
error_log /var/log/nginx/guni-error.log info;
location /wss/ {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-for $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_pass http://0.0.0.0:8000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
location/{
proxy_pass http://0.0.0.0:8000;
proxy_set_header HOST $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-for $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
port_in_redirect off;
proxy_connect_timeout 300;
}
location ~ /.well-known {
allow all;
}
location /static/ {
alias /home/ubuntu/vp/static/;
expires 30d;
}
}
私のブラウザがいることを伝えます。
提案がありますか?おかげさまで
たぶんこれはまだ利用できませんが、開発者は、このためのサポートを持ち込むことに取り組んでいます。詳細は下記をご覧ください。 https://github.com/django/daphne/pull/36 https://github.com/django/daphne/issues/35 – JJK