WebSocket connection failed
diff
HOBBYOP

2 years ago

Hello,

I'm having an error with WebSocket on my website. The JavaScript is as follows:

const chatSocket = new WebSocket('wss://__/ws/endpoint") And the error from the developer tools: WebSocket connection to 'wss://____/ws/endpoint' failed:

It doesn't give me any more information. On the deploy logs, it is as follows:

WARNING:django.request:Not Found: /ws/endpoint

This error doesn't make sense because when I do it locally, everything works fine. In my settings.py I changed CHANNEL_LAYER "hosts" to include the REDIS_URL. Other than that, I'm not sure how to connect my site to Redis to be able to run WebSocket connections.

7 Replies

2 years ago

The obfuscated error messages you have provided are not particularly helpful, please provide actual error logs.


diff
HOBBYOP

2 years ago

From the console:

"WebSocket connection to 'wss://_____/ws/endpoint' failed: ;

Chat socket closed unexpectedly"

From the deploy logs:

"WARNING:django.request:Not Found: /ws/endpoint"

Both of these error messages occur directly after connecting to the page.


2 years ago

The obfuscated error messages you have provided are not particularly helpful, please provide actual error messages.


diff
HOBBYOP

2 years ago

I'm not sure what you mean by error logs as opposed to the messages I've sent. These are the logs.


2 years ago

Please provide actual error messages.


diff
HOBBYOP

2 years ago

These are the error messages. Am I missing something? Where do I find error messages other than in what I've sent?


2 years ago

Again, The obfuscated error messages you have provided are not particularly helpful, please provide actual error messages... without the obfuscation.


Welcome!

Sign in to your Railway account to join the conversation.

Loading...