Re: Channels websocket disconnecting after ~1min

2018-02-04 Thread Andrew Godwin
That would be me trying to move deployment to Travis. I'll push it up now.

Andrew

On Sun, Feb 4, 2018 at 5:47 PM, Ahmed Magdy  wrote:

> Thanks!
>
> I don't know if it was on purpose but you forgot to update the pypi
> package.
>
> On Monday, February 5, 2018 at 1:59:45 AM UTC+2, Andrew Godwin wrote:
>>
>> Hi there,
>>
>> This is a bug that should be fixed in the latest release of Daphne that I
>> put out a few hours ago.
>>
>> Andrew
>>
>> On Sun, Feb 4, 2018 at 3:49 PM, Ahmed Magdy  wrote:
>>
>>> Hello, and sorry for lots of questions about channels.
>>>
>>> I can connect to the websocket from JavaScript and send/receive normally
>>> for exactly 60~61sec after that the HTTP request is repeated on it's own
>>> and the websocket disconnects.
>>> Sometimes the HTTP get request is repeated more than once before the
>>> websocket disconnection.
>>>
>>> Even just connecting and waiting for 60~61secs result in the same thing.
>>>
>>> Terminal log
>>>
>>> Django version 2.0.2, using settings 'husite.settings'
 Starting ASGI/Channels development server at http://127.0.0.1:8000/
 Quit the server with CTRL-BREAK.
 2018-02-05 01:35:22,350 - INFO - server - HTTP/2 support not enabled
 (install the http2 and tls Twisted extras)
 2018-02-05 01:35:22,351 - INFO - server - Listening on endpoint
 tcp:port=8000:interface=127.0.0.1
 [2018/02/05 01:35:27] HTTP GET /sessions/24/ 200 [0.05, 127.0.0.1:9066]
 [2018/02/05 01:35:27] WebSocket HANDSHAKING /sessions/24 [
 127.0.0.1:9067]
 [2018/02/05 01:35:27] WebSocket CONNECT /sessions/24 [127.0.0.1:9067]
 [2018/02/05 01:36:28] HTTP GET /sessions/24 503 [61.05, 127.0.0.1:9067]
 [2018/02/05 01:36:28] WebSocket DISCONNECT /sessions/24 [127.0.0.1:9067
 ]

>>>
>>> # settings.py
>>> # ...
>>> ASGI_APPLICATION = "husite.routing.application"
>>> CHANNEL_LAYERS = {
>>>"default": {
>>>"BACKEND": "channels_redis.core.RedisChannelLayer",
>>>"CONFIG": {
>>>"hosts": [("localhost", 6379)],
>>>},
>>>},
>>> }
>>>
>>> class MyConsumer(WebsocketConsumer):
>>>def connect(self):
>>>self.accept()
>>>
>>> // Javascript code
>>> ws = new WebSocket(`${protocol}://${location.host}/sessions/{{session.id
>>> }}`)
>>>
>>>
>>> --
>>> 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...@googlegroups.com.
>>> To post to this group, send email to django...@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/ms
>>> gid/django-users/63f72d2c-c5b7-4729-9d85-d4b1bcbe7e6e%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+unsubscr...@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/d3d44ca9-515b-4f42-b239-907150a0ae8f%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+unsubscr...@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/CAFwN1uqBx7kL5GGEz1%2B5jQD9g8ccHRuekZNu2v%3Ds9CyQ_JsyJg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Channels websocket disconnecting after ~1min

2018-02-04 Thread Ahmed Magdy
Thanks!

I don't know if it was on purpose but you forgot to update the pypi package.

On Monday, February 5, 2018 at 1:59:45 AM UTC+2, Andrew Godwin wrote:
>
> Hi there,
>
> This is a bug that should be fixed in the latest release of Daphne that I 
> put out a few hours ago.
>
> Andrew
>
> On Sun, Feb 4, 2018 at 3:49 PM, Ahmed Magdy  > wrote:
>
>> Hello, and sorry for lots of questions about channels. 
>>
>> I can connect to the websocket from JavaScript and send/receive normally 
>> for exactly 60~61sec after that the HTTP request is repeated on it's own 
>> and the websocket disconnects.
>> Sometimes the HTTP get request is repeated more than once before the 
>> websocket disconnection.
>>
>> Even just connecting and waiting for 60~61secs result in the same thing.
>>
>> Terminal log
>>
>> Django version 2.0.2, using settings 'husite.settings'
>>> Starting ASGI/Channels development server at http://127.0.0.1:8000/
>>> Quit the server with CTRL-BREAK.
>>> 2018-02-05 01:35:22,350 - INFO - server - HTTP/2 support not enabled 
>>> (install the http2 and tls Twisted extras)
>>> 2018-02-05 01:35:22,351 - INFO - server - Listening on endpoint 
>>> tcp:port=8000:interface=127.0.0.1
>>> [2018/02/05 01:35:27] HTTP GET /sessions/24/ 200 [0.05, 127.0.0.1:9066]
>>> [2018/02/05 01:35:27] WebSocket HANDSHAKING /sessions/24 [127.0.0.1:9067
>>> ]
>>> [2018/02/05 01:35:27] WebSocket CONNECT /sessions/24 [127.0.0.1:9067]
>>> [2018/02/05 01:36:28] HTTP GET /sessions/24 503 [61.05, 127.0.0.1:9067]
>>> [2018/02/05 01:36:28] WebSocket DISCONNECT /sessions/24 [127.0.0.1:9067]
>>>
>>
>> # settings.py
>> # ...
>> ASGI_APPLICATION = "husite.routing.application"
>> CHANNEL_LAYERS = {
>>"default": {
>>"BACKEND": "channels_redis.core.RedisChannelLayer",
>>"CONFIG": {
>>"hosts": [("localhost", 6379)],
>>},
>>},
>> }
>>
>> class MyConsumer(WebsocketConsumer):
>>def connect(self):
>>self.accept()
>>
>> // Javascript code
>> ws = new WebSocket(`${protocol}://${location.host}/sessions/{{session.id
>> }}`)
>>
>>
>> -- 
>> 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...@googlegroups.com .
>> To post to this group, send email to django...@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/63f72d2c-c5b7-4729-9d85-d4b1bcbe7e6e%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+unsubscr...@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/d3d44ca9-515b-4f42-b239-907150a0ae8f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Channels websocket disconnecting after ~1min

2018-02-04 Thread Andrew Godwin
Hi there,

This is a bug that should be fixed in the latest release of Daphne that I
put out a few hours ago.

Andrew

On Sun, Feb 4, 2018 at 3:49 PM, Ahmed Magdy  wrote:

> Hello, and sorry for lots of questions about channels.
>
> I can connect to the websocket from JavaScript and send/receive normally
> for exactly 60~61sec after that the HTTP request is repeated on it's own
> and the websocket disconnects.
> Sometimes the HTTP get request is repeated more than once before the
> websocket disconnection.
>
> Even just connecting and waiting for 60~61secs result in the same thing.
>
> Terminal log
>
> Django version 2.0.2, using settings 'husite.settings'
>> Starting ASGI/Channels development server at http://127.0.0.1:8000/
>> Quit the server with CTRL-BREAK.
>> 2018-02-05 01:35:22,350 - INFO - server - HTTP/2 support not enabled
>> (install the http2 and tls Twisted extras)
>> 2018-02-05 01:35:22,351 - INFO - server - Listening on endpoint
>> tcp:port=8000:interface=127.0.0.1
>> [2018/02/05 01:35:27] HTTP GET /sessions/24/ 200 [0.05, 127.0.0.1:9066]
>> [2018/02/05 01:35:27] WebSocket HANDSHAKING /sessions/24 [127.0.0.1:9067]
>> [2018/02/05 01:35:27] WebSocket CONNECT /sessions/24 [127.0.0.1:9067]
>> [2018/02/05 01:36:28] HTTP GET /sessions/24 503 [61.05, 127.0.0.1:9067]
>> [2018/02/05 01:36:28] WebSocket DISCONNECT /sessions/24 [127.0.0.1:9067]
>>
>
> # settings.py
> # ...
> ASGI_APPLICATION = "husite.routing.application"
> CHANNEL_LAYERS = {
>"default": {
>"BACKEND": "channels_redis.core.RedisChannelLayer",
>"CONFIG": {
>"hosts": [("localhost", 6379)],
>},
>},
> }
>
> class MyConsumer(WebsocketConsumer):
>def connect(self):
>self.accept()
>
> // Javascript code
> ws = new WebSocket(`${protocol}://${location.host}/sessions/{{session.id
> }}`)
>
>
> --
> 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+unsubscr...@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/63f72d2c-c5b7-4729-9d85-d4b1bcbe7e6e%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+unsubscr...@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/CAFwN1uqywU967ZSC19T7KT0rgH-m83e31HvGYxuG%2BRXdp5LRWw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Channels websocket disconnecting after ~1min

2018-02-04 Thread Ahmed Magdy
Hello, and sorry for lots of questions about channels. 

I can connect to the websocket from JavaScript and send/receive normally 
for exactly 60~61sec after that the HTTP request is repeated on it's own 
and the websocket disconnects.
Sometimes the HTTP get request is repeated more than once before the 
websocket disconnection.

Even just connecting and waiting for 60~61secs result in the same thing.

Terminal log

Django version 2.0.2, using settings 'husite.settings'
> Starting ASGI/Channels development server at http://127.0.0.1:8000/
> Quit the server with CTRL-BREAK.
> 2018-02-05 01:35:22,350 - INFO - server - HTTP/2 support not enabled 
> (install the http2 and tls Twisted extras)
> 2018-02-05 01:35:22,351 - INFO - server - Listening on endpoint 
> tcp:port=8000:interface=127.0.0.1
> [2018/02/05 01:35:27] HTTP GET /sessions/24/ 200 [0.05, 127.0.0.1:9066]
> [2018/02/05 01:35:27] WebSocket HANDSHAKING /sessions/24 [127.0.0.1:9067]
> [2018/02/05 01:35:27] WebSocket CONNECT /sessions/24 [127.0.0.1:9067]
> [2018/02/05 01:36:28] HTTP GET /sessions/24 503 [61.05, 127.0.0.1:9067]
> [2018/02/05 01:36:28] WebSocket DISCONNECT /sessions/24 [127.0.0.1:9067]
>

# settings.py
# ...
ASGI_APPLICATION = "husite.routing.application"
CHANNEL_LAYERS = {
   "default": {
   "BACKEND": "channels_redis.core.RedisChannelLayer",
   "CONFIG": {
   "hosts": [("localhost", 6379)],
   },
   },
}

class MyConsumer(WebsocketConsumer):
   def connect(self):
   self.accept()

// Javascript code
ws = new WebSocket(`${protocol}://${location.host}/sessions/{{session.id}}`)


-- 
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+unsubscr...@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/63f72d2c-c5b7-4729-9d85-d4b1bcbe7e6e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.