Tuesday, June 27, 2017

Re: Websocket, an existing connection was forcibly closed by the remote host. django-channels

I would need to see the full console output of the server, and a full package version listing of what you have installed to help you further.

On Sun, Jun 25, 2017 at 12:48 PM, Mike Johnson Jr <self@mikejohnsonjr.com> wrote:

So I'm getting the error as described in the title of this post.

I'm following this tutorial: https://gearheart.io/blog/creating-a-chat-with-django-channels/

Here's the full traceback:

In [1]: import websocket    In [2]: ws = websocket.WebSocket()    In [3]: ws.connect("ws://localhost:8000")  ---------------------------------------------------------------------------  error                                     Traceback (most recent call last)  <ipython-input-3-43b98f503495> in <module>()  ----> 1 ws.connect("ws://localhost:8000")    c:\Python27\lib\site-packages\websocket\_core.pyc in connect(self, url, **options)      212      213         try:  --> 214             self.handshake_response = handshake(self.sock, *addrs, **options)      215             self.connected = True      216         except:    c:\Python27\lib\site-packages\websocket\_handshake.pyc in handshake(sock, hostname, por  t, resource, **options)       67     dump("request header", header_str)       68  ---> 69     status, resp = _get_resp_headers(sock)       70     success, subproto = _validate(resp, key, options.get("subprotocols"))       71     if not success:    c:\Python27\lib\site-packages\websocket\_handshake.pyc in _get_resp_headers(sock, succe  ss_status)      125      126 def _get_resp_headers(sock, success_status=101):  --> 127     status, resp_headers = read_headers(sock)      128     if status != success_status:      129         raise WebSocketBadStatusException("Handshake status %d", status)    c:\Python27\lib\site-packages\websocket\_http.pyc in read_headers(sock)      224      225     while True:  --> 226         line = recv_line(sock)      227         line = line.decode('utf-8').strip()      228         if not line:    c:\Python27\lib\site-packages\websocket\_socket.pyc in recv_line(sock)       99     line = []      100     while True:  --> 101         c = recv(sock, 1)      102         line.append(c)      103         if c == six.b("\n"):    c:\Python27\lib\site-packages\websocket\_socket.pyc in recv(sock, bufsize)       78       79     try:  ---> 80         bytes_ = sock.recv(bufsize)       81     except socket.timeout as e:       82         message = extract_err_message(e)    error: [Errno 10054] An existing connection was forcibly closed by the remote host

I have redis running, manage.py runserver running, and I'm using django-channels. This is my first time working with websockets. Can anyone help out and let me know what's wrong?

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/878e70cd-4e39-4b1f-87bd-da7ddb03605b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAFwN1uq8_OAzv2e5eESaTpKoJO9-PC3wyA%2BxaE-2Vkxuwta7qw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment