WebSocket connection to 'wss://proyecto-mesero-ubuntu.onrender.com/wss/socket-server/' failed:

I have a websocket connection in my django project using daphne and channels like this: asgi.py file
os.environ.setdefault(‘DJANGO_SETTINGS_MODULE’, ‘MeseroVirtual.settings’)

#application = get_asgi_application()

application = ProtocolTypeRouter({
“https”: get_asgi_application(),
‘websocket’: AuthMiddlewareStack(
URLRouter(
MeseroVirtual.routing.websocket_urlpatterns

 ))

})
routing.py file:
websocket_urlpatterns = [
re_path(r’wss/socket-server/', OrderConsumer.as_asgi()),
]
and so I invoke it:
let url = wss://${window.location.host}/wss/socket-server/
console.log(url)
const socket = new WebSocket(url)
Locally it works fine but already in production in RENDER this error appears:
administrador/:611 WebSocket connection to ‘wss://proyecto-mesero-ubuntu.onrender.com/wss/socket-server/’ failed:

HI there,

To help us look more closely at the service having an issue here, can you please open a ticket directly with us? You can do this from the Help menu on our dashboard.

Regards,

Keith
Render Support, UTC+10 :australia:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.