var socket = new WebSocket("wss://localhost:22600/ws/message/")
socket.onmessage = (message) => {console.log(message.data)}
socket.send('{"message": "This is a test"}')
Browser Console Error:
Uncaught DOMException: Failed to execute 'send' on 'WebSocket': Still in CONNECTING state.
at <anonymous>:1:8
Command issued in Browser console:
Browser Console Error:
Browser: Chrome, Safari, Ingonito mode too
pip3 freeze: channels==3.0.4 channels-redis==3.3.1 daphne==3.0.2
BE command:
daphne -e ssl:443:privateKey=key.pem:certKey=cert.pem -b 0.0.0.0 -p 22600 my_project.asgi:application -t 60 -v 3