Closed patelrajnath closed 5 years ago
I didn't test it, but I can say from the description of Daphne that it's supposed to be used with Channels & ASGI which have different use case than this application and i probably would, recommend it. This application is supposed to be ran separately. Although, i suppose you could write custom Channels compatibility module for it to be used with Daphne.
Thanks for the response.
This application is supposed to be ran separately.
So if I want to use it with my application, how should I configure it? Please suggest. Thanks!
You can install it as stated in the readme and run on the server using systemd/supervisord directly as a python script.
There is an example.service
systemd script in the root folder of the app (similar to how you run Celery worker using systemd)
Please correct if I got it wrong.
So the example.service
, uses the settings from the example/example/setting.py
, which is currently-
CHAT_WS_SERVER_HOST = 'localhost'
CHAT_WS_SERVER_PORT = 5002
CHAT_WS_SERVER_PROTOCOL = 'ws'
CHAT_WS_SERVER_HOST
, I need to change it to a public IP and the same I should configure in my application. Is that correct?
Thanks!
Correct
Thanks! I'll try it and let you know.
Hi, I tried to run the chat_server as a standalone service (on localhost). Now I'm unable to connect to it from my application. When I run chat_server within my application (using application's manag.py) it works fine. Please suggest how should I configure them (chat_server and my application) separately and make them communicate (on localhost)?
Thank you!
What do you mean to run as a standalone server? It's meant to be ran with manage.py
It's meant to be ran with manage.py Ok. You mean my application's manage.py?
Actually, I run my application with docker-compose, which doesn't have access to the public IP. I can run chat_server with localhost and expose the port with the public IP. The tricky part in this case is that both chat-client (ws_server_path
in dialogue.html, var base_ws_server_path = "{{ ws_server_path }}";
) and chat_server uses the same setting. In my case I need to find a way to configure the chat-client (ws_server_path
in dialogue.html) on a public IP whereas chat-server is running on localhost (exposing the service via port). Does it make sense? or you would suggest any other way to achieve this?
Thanks!
For the time being I hard-coded my public IP in chat-client (ws_server_path
in dialogue.html) and now it works fine. However, having a little trouble using it with "wss://" as my TSL certificate is currently self signed. Any work around if you could suggest. Thank you.
Hi, I'm trying to configure the chat server with wss://
.
Now, I have a TSL certificate from a CA but when I run the chat server with it, and try to connect via chat-client, I get the following error-
failed: Error in connection establishment: net::ERR_CERT_COMMON_NAME_INVALID
Earlier I had (with self signed certification)-
failed: Error in connection establishment: net::ERR_SSL_PROTOCOL_ERROR
Anyone had this issue earlier? Thanks!
Got it.. The issue was that my certificate is with my domain name and in web-socket I'm trying to connect with IP. When I added exception for the IP in the browser I was able to connect. I'll see if it possible to use the same certificate with Common name and IP. Thanks!
You have been really helpful. Feel free to contact if you have something in which I could contribute.
The problem is that my certificate is with my domain name and in the web socket I am trying to connect with IP. When I added an exception for the IP in the browser, I was able to connect. I will see if it is possible to use the same certificate with common name and IP. how can i solve this problem can someone help me please
Hi, Please suggest how to run this with daphne?
Thank you!