All Questions
17
questions
0
votes
0
answers
19
views
React front end triggering WebSocket.onmessage twice
I'm new to React and am currently trying to create a real time chat app. I'm nearly finished. the last feature needed is that the React component pasted below needs to receive messages from the Django ...
-1
votes
2
answers
276
views
web socket url with domain name of backend container but doesnot resolve into ip of backend container
i made a docker container for react app and another for django app . now when i make a websocket call
const socket = new WebSocket(
// `ws://${WEB_SOCKET}:${WEB_SOCKET_PORT}/ws/lobby/`//this ...
0
votes
1
answer
157
views
How to apply web socket to all clients and all components in React?
so I try to create websocket like this code in First Component :
import { useState,useEffect } from 'react'
import Routes from './components/routers/Routes'
function App() {
const ws=new ...
0
votes
1
answer
87
views
Real time application (React + Django)
Just want to get some suggestion on what would be best approach to create a real time application.
What architecture and libraries should be used on both sides
I have looked int to sockit.io for front ...
3
votes
1
answer
2k
views
Django channels and react error: WebSocket connection to 'ws://localhost:8000/myURL' failed: WebSocket is closed before the connection is established
First-of-all, I still don't know whether the issue is on front-end or back-end side, but it seems like back-end is more likely.
I have built a Django application using django-channels to send packets ...
0
votes
2
answers
632
views
Unable to connect to django channels on react native app using web sockets
I am trying to use web sockets to connect to Django Server/Channels. The HTTP views are working but the "ws" ( WebSocket ) connection is being rejected but ONLY on The REACT NATIVE APP. It's ...
2
votes
1
answer
826
views
React Django WebSocket connection challenge
The challenge I am facing is in trying to connect my Django backend with React frontend app.
The error that I am getting is:
WebSocket connection to 'ws://localhost:8000/ws/week/' failed: _callee$ @ ...
0
votes
1
answer
429
views
How to create WebSocket in React-Native correctly, It gets created multiple time
I'm trying to make a chat application with django-channels and react-native
but I don't know how to create the WebSocket
I tried this:
const ChatScreen=({navigation, route})=> {
room = route....
1
vote
1
answer
825
views
Can't establish connection between React JS & Django Channels
I have a web app using Django Rest Framework and React. I am trying to add web sockets to it. I opted for Django channels as they are the most recommended.
However, I keep getting this error Firefox ...
0
votes
1
answer
879
views
React State giving undefined, new to react
I'm new to react-native, I have been working on a simple app but for some reason I keep getting (undefined) for some of my states, also when fetching data the server is getting called multiple times ...
2
votes
1
answer
1k
views
Can not setState on Websocket.onmessage
I am trying to implement a chat page for my app.
I am using react and django channels.
I am having a problem with rendering the message on Websocket.onmessage
Here's the code that gives me the error
//...
0
votes
1
answer
1k
views
Is sending token authentication information via cookie headers secure?
0
i am by no means a security engineer , and i have barely started my journey as a web developer. Im utilizing a python package known as django for my backend , react.js for my front end . Recently i ...
0
votes
1
answer
577
views
django channels custom token authenticated Websocket keeps disconnecting ERR_CONNECTION_RESET
i using react as my front end and django as my backend , as such , it requires me to use token based authentication with django channels. The method i am employing is by sending the authentication ...
1
vote
1
answer
2k
views
Token authentication for django channels
im trying to integrate React , django and django channels together , however im facing some trouble trying to authenticate the socket connection.
There are some posts over here:
first link
enter ...
5
votes
6
answers
5k
views
self.scope['user'] in Django channels keeps showing up as AnonymousUser
When I log in to my front end, my self.scope['user'] call in my friends.consumer.py in django channels returns AnonymousUser but when login and call self.scope['user'] in my chat.consumer.py it shows ...