Recently, I configured my socket io connection to send information to the frontend and receive responses from the client. The data is successfully saved as well. However, it seems unnecessary to initialize socket io in the server.js file when its function ...
I have set up an express.js server-side and followed the socket.io guide. However, I am facing issues with the socket connection not being successful, and there seems to be a high number of unexpected GET requests like this: https://i.stack.imgur.com/GDGg ...
Currently, in my express server setup, I am utilizing socket.io and Redis pubsub. The process involves the server subscribing to a Redis message channel and then forwarding any incoming Redis messages to a specific WebSocket client whenever a new message i ...
Sharing my socket server code: const io = require("socket.io")(8080, { cors: { // origin: "http://localhost:3000", origin: "https://mern-bubble.herokuapp.com", }, }); This is the client-side implementation: useEf ...
I am trying to incorporate socket-io into my project and have set it up on both the server (node-js) and the client (react). However, I am encountering issues as it doesn't seem to work properly. In the server console, I am unable to see the message user c ...
I am struggling to achieve a realtime crud operation using vuex, node, express, and socketio with the current syntax provided. Here is the code snippet: Server index.js const server = app.listen('3000',() => { console.log('<--- ...
I'm currently facing an issue with establishing a connection between my Next.js/React client and my Express/Socket.io backend (not running as a Next.js custom server). When I attempt to proxy regular HTTP requests using rewrites in the next.config.js ...
The server.js file I am currently running is set up as follows: module.exports = server; var express = require('express'); var fs = require('fs'); var server = express.createServer(); var port = 58000; server.listen(port); var io = require('socket ...
I am diving into the world of node.js for the first time and seeking some guidance: Here are the programs I have installed on my server: node.js v0.11.3-pre express v3.3.4 socket.io v0.9.14 connect-redis v1.4.5 Redis server v=2.6.14 redis-cli 2.6.14 To ...
I recently started using the Angular library angular-socket-io for my project. However, I encountered a challenge where I needed to implement authentication within the app before initializing the socket.io interface. To address this issue, I found and impl ...
Recently, I encountered an issue while hosting my application on OpenShift with a custom domain. The problem arose when socket.io failed to download the client-side script, leading me to resort to using a CDN instead. However, this workaround has caused an ...
My setup includes a Node.js server and a React.js client application. Data is exchanged between them using socket.io, but I'm running into an issue with implementing acknowledgment. Whenever I try to implement acknowledgment, I receive a timeout error: Err ...
Currently, I am incorporating socket.io within a NodeJS application. The socket.io page can be accessed at localhost:8081/socket.io/. However, my goal is to have it located at localhost:8081/hola/socket.io/. Is this achievable? var express = require("e ...
Currently, I am in the process of unit testing an angular service within my application that is responsible for creating a socket.io client. The structure of my service can be seen below: export class SocketService { private name: string; private host ...
Incorporating Socket.io into my project has been a key component. I have developed a plugin specifically for managing socket connections... await server.register(socket_connections); This code snippet illustrates the structure of the socket_connections p ...
Is it advisable to switch AJAX routes (called with $.Ajax in jquery) like: GET /animals GET /animals/[id] POST /animals To socket.io events (event bound on client and server for client response): emit("animals:read") emit("animals:read", {id:asdasd}) ...
I am currently working on setting up a frontend React app to communicate with a NodeJS Express API using socket.io import React, { useEffect, useState } from "react"; import io from "socket.io-client"; const socket = io("http://lo ...
My private chat application is built using socket.io, node.js, and MySQL. However, I encountered an error when trying to use socket.on('example', function(data){...});. The error code thrown is related to a possible EventEmitter memory leak with 11 listene ...
Currently, I am utilizing the most recent version of socket.io (1.0.6) to develop an online multiplayer game using Phaser and Node. One issue that has arisen is that after the clients connect, they will sporadically disconnect without any specific pattern. ...
Just a quick question. I'm currently in the process of creating an online browser game with phaser and socket.io. I know I'll be using socket.io quite a bit, but what about express? Once I start the server, what other tasks will I need to complet ...
I am interested in creating an angularJS promise that can work seamlessly with socket.io. Currently, I have a callback function set up to handle the response like this: function request(event, data, callback) { socket.emit(event, data); socket.on( ...
I am currently working on developing an instant messaging app (chat) using socket.io and Angular. I have two main files: index.html and index.js as shown below. The chat functionality is working well, but I am facing an issue where the messages do not appe ...
Having scoured the depths of various resources, including SO and Google, I have hit a roadblock. I am struggling to understand why the socket is failing to capture the uploaded file via the form; it simply stops after connecting. When I check the console, ...
I have set up a node.js server with an angular.js frontent and I am facing a problem with Socket.IO connections. The issue arises when double Socket.IO connections open, causing my page to hang. var self = this; self.app = express(); self.http = http.Ser ...
Using openshift with express, I have been experiencing difficulties configuring socket.io. No matter what adjustments I make, it seems to disrupt my application. What could be the issue? Interestingly, when I disable the sections related to socket.io, the ...
I have created a provider (I tried with a controller as well, but got the same results). Here is my code: .provider('socketio', function() { this.socket = io.connect("//localhost); console.log("LISTENING..."); this.$get = function() { [...] } ...
I've been working on this issue and have tried various methods, but haven't had any luck so far. Despite reading through a lot of documentation and posts, I can't seem to figure it out. What I need is for a message sent to a specific user (usuarioActual.u ...
One of my goals is to send data to clients connected to a socket.io server directly from my express routes files. In my app.js, the structure is as follows : var express = require('express'); var app = express(); //routes require('./routes/test')(app); ...
My Node server is responsible for managing user sessions, chatrooms, messaging, web scraping, and other tasks. Sometimes, when attempting to send messages from the website to the Node server, I encounter a 404 error in the response. This issue occurs rare ...
Need help with app.get('/') not being called I am working on implementing cookies to allow multiple users to be logged in simultaneously. Currently, users can log in successfully. However, upon refreshing the page, all users get logged in as the ...
When it comes to retrieving the logged in user using passport.js in most of my routes, it's a breeze - just use req.user.username. However, I've encountered an issue with a page that relies solely on websockets. How can I determine the username of the logg ...
As I've been working on my app for a while now, scalability issues have started to arise. With my limited experience in Node and Heroku, I'm reaching out for some guidance. Initially, I followed this tutorial to set up my node service, essentially creatin ...
Is there a way to transmit data from the client side to the server side when a user disconnects from a socket.io connection in Node.js? I attempted creating a new event and calling it within the 'disconnect' event, but it seems impossible since the conne ...
Currently, I am working on a web application that utilizes Angular and Express. To handle database updates, I have implemented a REST API and incorporated SocketIO for real-time client updates. I have managed to track a list of active socket IDs for each ...
Struggling to establish a connection with socket io. app.js file var express = require('express'); var path = require('path'); var mongoose = require('mongoose'); var cookieParser = require('cookie-parser'); var in ...
I've been experiencing frequent crashes with my node.js server recently, all due to a recurring socket.io error. It seems that the client may be sending invalid UTF strings, causing an error in the utf8.js file. I'm getting frustrated with the co ...
Struggling with a persistent issue here. Despite reading numerous documents and posts from others on the same topic, I can't seem to find a solution to prevent this problem. I am intentionally shutting down the redis server to avoid potential disaster ...
I'm facing an issue in my node.js / Express.js app where I need to pass parameters with the socket.io connection (saw a solution in another post). On the client side, here is a snippet of my code: edit var socket = io.connect('/image/change&ap ...
After recently transitioning from Socket.io 2.x to 3.0.3 and integrating it with [email protected], I encountered an issue. Following the instructions provided in the original migration documentation, I attempted to retrieve a list of all open socket ...
My application recently encountered an error. "Access to XMLHttpRequest at '' from origin '' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource." When connecting to socket.io, I haven't ...
Currently, I am developing a web application that utilizes NodeJS, Express, and MongoDB. Within this application, there is a view accessible to all users which displays different images based on the selection made by the user (no login required). This spec ...
I am currently facing some challenges with authenticating users in socket.io for my chat application. I am storing all users in an array using the following structure: let sockets = []; sockets[userdbId] = socket.id However, there are a few issues that I ...
While utilizing Apache on Ubuntu 15.04, I am attempting to eliminate port 3000 from the URL and modify the path to http://example.com/{app}/socket.io... By employing ProxyPass and ProxyPassReverse, I have successfully removed the port from the URL and adj ...
I've written the Express code in my server JS file: app.post('/confirm', function (req, res) { // Currently struggling to send a socket using emit() }); Here is the Socket.io code I have: io.on('connection', function (client) { // Implementing all ...
I am attempting to create a scenario where nodejs triggers an event in an irc chat that causes a html page (Running on *:3000) to execute some JavaScript. However, I am facing an issue where the showDiv(); function is not being executed as expected. Curre ...
While working on a basic socket.io application using React and Express, I've encountered an issue where two clients are facing difficulties in sending data to each other. For instance: Player 1 connects to the server followed by Player 2. Player 1 ...
I'm in the process of building a multiplayer TicTacToe game using Flutter and Node.js with Socket.io integration. Here is the code: Flutter late io.Socket socket; final String url = 'http://localhost:5000'; @override void initState() { super ...
I am currently experiencing an issue with a Socket.io server that is running through an Express.js server with Next.js. The server is sending errors without any client being connected. However, clients can still connect from the browser without any proble ...
I keep encountering an error in my application (using Node.js as API) and Angular 8 as frontend. The error message says: Access to XMLHttpRequest at 'http://localhost:3000/socket.io/?EIO=3&transport=polling&t=NQJpoTm' from origin 'ht ...
I am new to Vue.js, Socket.io, and Node.js. Recently, I developed a single-page application that allows communication between a Node.js server running on a Raspberry Pi and a Siemens S7-1500 PLC connected via Ethernet. The Raspberry Pi acts as a WiFi acces ...
I am currently in the process of implementing a chat feature for my app and I'm contemplating the most effective approach to achieve this. Here is the concept I have in mind: The user will select who they want to communicate with, then record an aud ...
Is there an example available that stores sessions and uses those sessions for all opened windows, allowing one user to connect to a specific room only once? This application will treat phpsessions as node.js sessions, but I am struggling to restrict acce ...
Currently, I am in the process of developing a straightforward website to showcase socket communication and chat capabilities. The server side is coded using Python Flask app, while the client-side utilizes JavaScript. Below is an excerpt from the server c ...
I'm currently developing a game server that involves players entering a game room and getting paired with another player. One feature I would like to implement is displaying the game board without having to reload the page in order to avoid reinitiali ...
I have been working on an angular application that was initially developed in Angular 2, then upgraded to versions 7 and 9, and now I'm attempting to migrate it to Angular 11. There is a function in my code that fetches the notification count for the ...
I have been working on developing a real-time application using NodeJS as my server and Socket.IO to enable live updates. However, I encountered an error message that reads: WebSocket connection to 'wss://localhost:1234/socket.io/?EIO=3&transport=we ...
Exploring the fundamentals of Socket.io and aiming to establish a connection ONLY when a user logs in. The official documentation doesn't provide clear guidance on this specific implementation. Utilizing JWT for authentication and Node.js for server-side p ...
Imagine a scenario where you have developed a chat app similar to WhatsApp Web. In this app, the chat section displays all chats on the left and in the middle. Upon user login, the first contact is saved in the Redux store as selectedChatUser. All the cha ...
As a new socketIO user, I am working on a website with 2 game modes. Initially, my plan was to create separate scripts for each mode, but now I am considering consolidating everything into one script. Currently, my script emits data to all connected users, ...
I have integrated session.socket.io into my application. o = require('socket.io').listen(tmpServer), appCookieParser = express.cookieParser(settings.cookie.secret), appRedisStore = new RedisStore(), sessionIO = new SessionSockets(io, appRedisSto ...
My current task involves sending a message to all connected sockets on my server using socket.io. The code I have written so far looks like this: if(electionExists) { var connectedClients = io.sockets.adapter.rooms[electionRequested].sockets; ...
Upon a user joining, I alter their ID to a shortened random code. This change is made to utilize the id as a visible session ID on the front-end. I mention this to prevent confusion regarding non-standard socket IDs and their relation to potential issues. ...
Recently I started coding with AngularJS and decided to build a real-time app using Socket.io: The service I'm using shows that the connection is fine on the console. Here's a picture of the Console.log output However, when I attempt to emit c ...
I'm currently developing a multiplayer chess game using NodeJS and socket.IO. I've been facing challenges trying to host it on Azure. I've attempted various approaches, including: Enforcing the use of WebSockets by adding the following code: io.configur ...
Recently, I developed a real-time chat application using socket.io, Node.JS, and express. It was functional on my local server but now I want to connect it to an existing Heroku service instead. How can I achieve this? Once I tried the following code, va ...
My code structure is designed as follows: //Route Handler that triggers when a user 'creates a session' app.post('/route', async (req, res) => { let var1 = []; let var2 = []; io.on('connection', (socket) => ...
Hello all. Currently, I am developing an online users script using NodeJS and SocketIO. The functionality works fine, however, I am encountering an issue where if a user connects from multiple browsers, windows, or devices, it displays duplicate results li ...
Whenever I establish a connection to the server socket from the client side, specifically using React, I notice that the socket client sends repeated requests every few seconds. These requests are primarily of the "get" type and often end up in a pending s ...
What is the best way to develop a chat application for direct communication between two individuals? For instance, imagine a website with numerous producers where a consumer wishes to engage in a live chat with a specific producer. Any ideas on how to ach ...
I have encountered an issue regarding the use of async pipe with Observables. Initially, I assumed that returning an Observable from my service on a socket.on event would suffice. However, it appears that my approach is incorrect. Can you guide me on the c ...
I am facing an issue with removing users from Socket.IO when their browser is closed. The 'user' in the array 'users[]' is not getting removed or updated. Additionally, I would like to update the users on the client side as well. Can someone assist me in r ...
As I work on developing a React Native Expo app that requires real-time communication using socket.io, my Node.js server is up and running on localhost. Here's the code snippet: In React Native - home.js import { io } from "socket.io-client"; c ...
I am facing a unique scenario where a client (browser) connects to server A, which in turn is connected to server B and C. When the client sends a message to server A, I need to route that message to a specific server, either B or C, but not both. Essentia ...
I am currently attempting to run a Node.js application on my server using SSH. When I run 'node server.js' in the terminal, everything seems to be running correctly: var express = require('express'); var app = express(); var server = app.listen(5431); app ...
I am intrigued by whether there is a distinction, other than readability, between code snippets like: socket.emit('m','something'); and socket.emit('chat message','something'); Is switching from the second option to the first substantial enough in redu ...