openwisp/openwisp-notifications

[Websocket] Connection failed

Closed this issue · 5 comments

I am running my website on http:// and somewhere a notification module websocket is trying to connect on wss://
Here is a screenshot:
test1Fail

Fun stuff, I need to add INTERNAL_IPS = ['<IP-address>'] as given in the documentation!

@pandafy Can this be done as it's done in the django-loci module or would some external library used would not allow that?

Yes @atb00ker, it will be more logical to implement it as it is done in django-loci-module.

The changes were brought in #79, it can be used as reference on what to remove.

Also, I believe this section of README should be removed:

By default, websockets communicate over ``wss`` protocol. If for some reason, you want them to communicate
over ``ws`` protocol e.g. while development, you will need to configure ``INTERNAL_IPS`` setting accordingly.
For more information please refer to
`"INTERNAL_IPS" section of Django's settings documentation <https://docs.djangoproject.com/en/3.0/ref/settings/#internal-ips>`_.

@pandafy @atb00ker can I please take this up? I think I have figured out where to make the change and am also thinking about adding a plausible test for it.

Hi @sankha555

You don't need to wait for assignment.
You can start working on it and create a PR.
The simple rule is that if there is a recent PR opened for an issue, ask before working on it, if there is no activity, feel free to start. 😄