Ask coding questions

← Back to all posts
Socket Problem Node
aboutabot

Hey, I just learned SocketIO and Express on a tutorial and I don't really know it that well, and I tried to send a message from one client to the server to the other client in a room. This only works if I run the repl from the server, and then reload both the https://server.aboutabot.repl.co page and the replit page I coded it on.
help?

Comments
hotnewtop
Geocube101

You may have to serve the html file containing your client side code

aboutabot

@Geocube101 I put it in now, but it no longer asks me for my room name or my name in the alert prompt

Geocube101

@aboutabot there is an issue with the <script> tag as the html page cannot locate the js files.
Try using:

...to load your script.js file

aboutabot

@Geocube101 Ok, now I changed that, but the alert prompt still doesn't come.

Geocube101

@aboutabot Ok, I had another look at my node.js repls. The script tag needs the full path to your file so try: