#electron & socket.io - makes new socket connection after page refresh

19 messages · Page 1 of 1 (latest)

drowsy heron
#

well im trying to make a simple chat app using electron.js and socket.io, i made 2 "guis" chat and login html, when i switch between them, the socket.id is always other than previous - it connects to the new socket after any page refresh. I want to connect to the socket on login, if the username box isnt null - it should check if the username exists on server, after that it should go to chat html and then it should listen for new messages and allow user to send a message to the socket

rare estuary
#

thats how web works

#

when you refresh the page, it restart sockets as well

drowsy heron
#

?

rare estuary
#

no

drowsy heron
#

so uh i would need to make everything in

#

1 file

#

?

#

and then change the html source every time

rare estuary
#

yes

drowsy heron
#

aw

#

aight

#

thank you for help

rare estuary
#

or make proper sessions identification

#

between sockets

drowsy heron
#

u mean like session ids and stuff

rare estuary
#

yes

drowsy heron
#

aight