Questions tagged [sockets]

An inter-process communication endpoint that supports bi-directional data flow. Although commonly used in network connections, it can also be implemented in various other contexts. It should not be mistaken for WebSocket, a specific protocol, or any other abstractions like socket.io.

Experiencing difficulties establishing a connection with my NodeJs server socket and TypeScript

I've been struggling to run the code from this post and I really need some help. The code can be found at: https://medium.com/@mogold/nodejs-socket-io-express-multiple-modules-13f9f7daed4c. I liked the code as it seems suitable for large projects, but I'm ...

Error message "Uncaught ReferenceError: io is not defined" is displayed by Socket.io

I've been working on integrating sockets into my app, but have run into an error https://i.stack.imgur.com/4lUF7.png Interestingly, when I tested the socket functionality in a separate test app using the same code, everything worked perfectly. However, wi ...

Something went wrong while attempting to decode JSON in Python due to a missing comma delimiter

How can I send JSON data using sockets in Python? {"receiver": "2", "sender:": 1, "seq_num": 10, "data": "{"iv": "jdjhvwGriJ95kZwgDWlShw==", "ciphertext": "Fg7ugYYAn ...

An issue with npm arises on Windows 10 insider preview build 14366

It appears that npm and nodejs are experiencing issues on the latest Windows version build 1433 When I ran the following command: npm -v events.js:141 throw er; // Unhandled 'error' event ^ Error: This socket is closed. ...

The socket.io.js file could not be located while using (nodejs with express [4.13] and socket.io [1.3])

Currently, I am utilizing express 4.13 and socket.io 1.3.2 along with an express generator. Here is the code snippet from my app.js: var app = express(); var server=require('http').createServer(app).listen(app.get('port'),'127.0. ...

SPA application utilizing both public and private socket.io connections

My web application caters to two types of users: public users who have yet to authenticate, and private users who are logged in and have authenticated themselves. Using token-based authentication in a single-page app, there are no page refreshes after the ...

Splitting data in NodeJS sockets

Whenever I encounter the need to divide data, my standard practice involves converting it into a string format. Here's an example of how I handle data in my function: socket.on('data', function (data) { var str = data.toString().spl ...

Using JavaScript and node.js, make sure to wait for the response from socket.on before proceeding

My task involves retrieving information from the server on the client side. When a client first connects to the server, this is what happens: socket.on('adduser', function(username){ // miscellaneous code to set num_player and other variabl ...

Events trigger React to render multiple times

I have implemented socket functionality on my website where users can send a word to the server, triggering an event (art-addpic) that broadcasts an image URL corresponding to that word to all users. However, only users with isArtist=true are allowed to re ...

Setting up sockets.io with npm on our Vagrant environment

Upon executing the command in my Unix Vagrant box, sudo npm install -g socket.io, I receive the following response after a few seconds: > <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="e39490a3d3cdd7cdd0d2">[email p ...

Guide on establishing connections with multiple socket clients in nodejs

Imagine this scenario: I have a server where socket(1) runs, and another server where socket(2) client connects to socket(1). Additionally, I have one browser socket that connects to socket(1). The goal is to send requests from the browser and retrieve d ...

Messages are not being emitted from the socket

I've been encountering an issue with message transmission from client to server while using React and ExpressJS. When I trigger the sendMessage function on the client side, my intention is to send a message to the server. However, for some reason, the serv ...

What is the process for creating a connection reset in a programmatic way?

Have you ever encountered the frustrating "the connection was reset" message while attempting to surf the web? (This specific text is from Firefox, other browsers may vary.) Occasionally, I find myself needing to intentionally trigger this error message i ...

Every time I try to utilize the socket module in Python, I encounter the issue: 'socket.gaierror: [Errno 11001] getaddrinfo failed'

Currently, I am working on a straightforward script that sends messages from a client to a server. Everything works smoothly when the client and server are on the same computer. However, an issue arises when attempting to send a message from a different la ...

Accessing OrientDB from PHP

Looking for assistance with creating a PHP adapter for the binary API of OrientDB, specifically regarding socket communications. Struggling to establish a connection between PHP and OrientDB, seeking help from someone familiar with raw socket communicatio ...

Is there a way to use socket.io to send an emit message to a specific individual client

I have reviewed various solutions but none of them seem to address my issue. I am currently working on developing an online multiplayer chess game. Let's say I have a roster of participants and 10 users are actively listed. My goal is for the admin ...

The validation in React seems to be malfunctioning when used in conjunction

Currently, I am receiving data from the backend through a socket connection. The data (item) is then pushed to an array. However, if a certain variable is set to true (indicating that it's paused), I do not want to push the item to the array. cons ...

Express and socket.io do not allow the sharing of socket sessions

I've been struggling to pass session data from socket.io to express routes using express-socket.io-session. Despite saving the data on the socket's "connection" event, my express routes are not able to access the updated session variables. I have ...

The Mystery of Socket.io Random Disconnects (version 1.0.6)

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. ...

The integration of socket.io with static file routing in node.js is encountering issues

I am currently developing a chat application and I have encountered an issue. When the static file routing is functioning correctly, the socket.io for the chat feature throws a "not found" error in the console. http://localhost/socket.io/?EIO=3&tran ...

Socket connection issue causing Laravel Event not to display on registration

I want to display notifications for new users who have registered on my website, so that existing logged-in users can see messages like "blabla has registered...". To achieve this, I first created an Event class along with a channel setup: class UserSign ...

Sometimes the messages from a web socket (socket.io) seem to be non-existent, while other times they flood in all at once unpredictably

Every time I start my server, the web socket sends me 1 initial response with information about Bitcoin. However, I am facing an issue where I either do not receive updates when the price changes or suddenly receive a large number of updates all at once. I ...

Using Socket.io to securely store user authentication is the most effective method

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 ...

Troubleshooting EAGAIN Errors When Opening Multiple UNIX Domain Sockets in Node.js

My current setup in terms of web service operation is as follows: We have multiple clients sending requests to a web server, which then passes those messages on to a C program via a UNIX domain socket. Historically, I've relied on Apache and PHP to handl ...

What are the steps to incorporate metrics middleware for Socket IO notifications, specifically monitoring both emitted events and listener activity?

I am currently working on a project that involves tracking all socket.io notification transactions initiated by the server, resembling an API request/response counter to validate subscription validation. Our team is utilizing an express middleware to moni ...

Laravel picks up on hushed tones

Is there a way to send messages from the client to the server using Laravel Echo and then save those messages in a database? I did some research and found out that the whisper method can be used to send messages to the Redis server. window.Echo.join('room' ...

Having trouble reaching the io object in session.socket.io

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 ...

Setting the starting sequence number for a TCP socket

I'm currently involved in testing and I require the ability to set the initial sequence number (ISN) of a TCP connection to a specific value. The ISN is typically a random value chosen by the OS/Network Stack, but I need to have control over it. Is there ...

What are the alternatives to using Node.js for implementing real-time chat functionality in core PHP using socket.io?

I am in the process of integrating socket.io into my core PHP custom framework. I prefer not to use node.js because it may cause conflicts with my existing AJAX code. 1) Is there a way to use socket.io without relying on node.js? 2) If node.js is necessar ...

Managing disconnection using Python's jsocket

I have implemented a json socket server/client using the jsocket python library. The issue I am facing is that my server crashes after the first time the connection is closed. How can I ensure the server stays running? Below is the code for the server: i ...

The TCP Server functionality is restricted to the localhost environment

While I can successfully establish a TCP connection between a TCP client and TCP server on localhost, I am facing difficulties when trying to replicate the same setup for connections involving different computers within the same network range. Specifically ...

Get rid of the port in Socket.IO and alter the directory

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 ...

Utilize socket communication with node.js to monitor and identify user

I'm attempting to find a method to unsubscribe from a Redis channel when the user navigates to another page within our website. I have attempted to detect a disconnect socket event when the user clicks on a link, but unfortunately, the event is never trigg ...

Node.js - Unity, Socket experiences intermittent disconnections despite attempts to reconnect

I'm currently working on a Node.js - Unity game that utilizes sockets for user connection to the game. I've encountered an issue where the connection seems to be constantly reconnecting and disconnecting in a loop within Unity. However, when I te ...

Make sure not to establish a Socket.io connection more than once

I am currently using React on the frontend and Express on the backend. The code snippet below is what I have written to establish a connection between the client and the server: import React, { useEffect, useState } from 'react'; import { io } from "socke ...

Utilizing Socket technology in combination with Sails JS and React JS

Currently, I have a live bidding system in place. On the bidding page, we display both the base price and current bid price of an item. Whenever a user updates the price of an item, I would like that new price to automatically reflect for all customers who ...

A messaging application powered by socket.io and the Express JS framework

I am currently learning Node.js and I am encountering an issue with using socket.id to identify logged in users on the client side using their email id and password. The verification process happens on the server side, and if successful, the user's so ...

In Python, utilizing ZeroMQ, numerous clients can connect to multiple servers for message discovery

After struggling with this issue for some time, I have decided to seek help from experts. Language: python The problem/setup: I am managing multiple clients, client[n], client[n] .. etc I also have several servers, server[n], server[n] .. etc Each se ...

Connection to socket.io refused due to ERR_CONNECTION_REFUSED

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 ...

Delivering HTML with Python Socket Server

I am currently learning about HTTP/CGI and exploring how to display HTML content on a webpage through the use of the socket library in Python. However, I am encountering some confusion regarding the correct syntax for this task: #!/usr/bin/env python impo ...

Sockets causing a blockage in the Express server

Encountering an issue while setting up an express server with Sockets (using the socketcluster-server module). After sending around 20 http requests, the express server gets blocked, leading to the Sockets (client) reporting a connection depletion. Has an ...

Integrating io.connect with Node.js within a Laravel project

Hello, I am facing an issue with my io.connect("mydomain:3000") call in my Laravel view file. When testing on localhost where "mydomain" is replaced with "http://localhost", I see an error in the browser console saying "Failed to load resource: the server ...

Establishing a connection using stream_socket_client that includes the ability to set

Looking at this block of PHP code: $fp = stream_socket_client('ssl://gateway.sandbox.push.apple.com:2195', $err, $errstr, 60, STREAM_CLIENT_CONNECT, $ctx); The number '60' in the code represents a timeout for the connection establishm ...

Error message encountered upon initializing a node.js application with Socket.io

I am currently utilizing socket.io for internal communication within my node.js application. While the code functions properly on my development machine, a continuous stream of messages appears during app startup on the main server: GET /socket.io/?EIO=3& ...

A step-by-step guide to integrating cloud computing and creating tokens using PHP

I am looking to create a cloud computing project using PHP. The main goal of this project is for users to store their files on a cloud server and if any unauthorized manipulations occur, the system should be able to detect and correct them. My question is ...

Establishing live video streaming with OpenCV via sockets in Python 3

I am currently working on a project to develop a simple application that can live stream video using Python 3 and OpenCV over a socket. I have limited experience with both OpenCV and socket programming, so any detailed answers would be greatly appreciated. ...

Ways to determine the character count of a message in Socket.IO

How can I retrieve the length of a socket io message (in a variable)? I attempted to use this code below, but unfortunately, it did not yield the desired result. socket.on('message', function (message) { var messagelength = message.length; / ...

Mastering communication between Android devices and handling complex data structures through socket programming

Recently, I've been exploring Android and I have a task at hand to establish a TCP socket connection and listen on a specific port. The client application will be sending me 2 images along with a related string. Instead of transmitting each piece of d ...

Unable to display socket data in Angular js Table using ng-repeat

div(ng-controller="dashController") nav.navbar.navbar-expand-sm.navbar-dark.fixed-top .container img(src='../images/Dashboard.png', alt='logo', width='180px') ul.navbar-nav li.nav-item a.nav-link.active(href= ...

Socket IO: Error - The call stack has exceeded the maximum size limit

Whenever a client connects to my node.js server, it crashes with a 'RangeError: Maximum call stack size exceeded' error. I suspect there's a recursive problem somewhere in my code that I can't seem to find. This is the code on my server: require('monitor ...

Evaluating code in Node.js REPL

Currently, I am working on integrating an evaluation feature into a Node.JS REPL. However, when trying to execute it, I encountered the following error: TypeError: Property 'eval' of object #<REPLServer> is not a function. Below is the exce ...

Transmitting an array through Socket.IO using the emit() method

I am currently developing an array in my socket io server and then transmitting it to the client. var roomList = io.sockets.manager.rooms; // creating a new Array to store the clients per room var clientsPerRoom = new Array(); //for (var i ...

Incorporate chat functionality into a Flutter app without relying on Firebase

Looking to add chat functionality to my app as a feature request. The backend is built in nodejs, so I'm exploring different ways to achieve this. Tried using socket.io but ran into compatibility issues between socket.io and flutter. My preference is not ...

The websocket server implemented in Node.js with the use of the "ws" library is exhibiting a peculiar behavior where it disconnects clients at random intervals,

My WebSocket server implementation is quite simple: const WebSocket = require('ws'); const wss = new WebSocket.Server( { server: server, path: "/ws" }); wss.on('connection', function connection(ws, req) { console.log("Connected"); ws.on('mes ...

Re-establish a connection to the TCP/IP socket in a NodeJS environment

Utilizing the "net" library, I am creating TCP connections on my Node.js server. root.socket = net.createConnection(root.config.port, root.config.server); I am currently working on handling errors that occur when the remote server goes down and implement ...

Eliminating the need for session and socket pooling in Sails.js

Hello, I am currently developing my rest api app using sails. I came across an interesting article on improving Node.js performance, which you can find here. One of the suggestions in point 2 was to eliminate socket pooling by setting options.agent to fal ...

Unable to establish communication between server and client using socket.io in conjunction with NodeJS, ReactJS, and Express

After reviewing various sources like blogs and videos, it seems that establishing a successful connection between the server and client is achievable. However, I am encountering difficulties implementing this on my own system. Below is the code snippet fo ...

Why am I encountering difficulties connecting to the Socket IO object in Node.js using Express?

Encountering a strange issue on the remote server side where everything works fine locally with a self-signed cert over https. However, when moving the code to the server, it works locally but not remotely. A node app is created and hosted on the server u ...

The abrupt end of an HTTP connection occurs in a Node.js application deployed on Amazon EC2

I am currently running a REST API on Amazon EC2 using Node.js (Express). During a specific REST call, the client receives a reply of approximately 5MB. However, before the client can fully receive the reply, an error message is displayed: Premature end o ...

Setting up Socket.io results in numerous transport polling GET requests being initiated

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 ...

Provide net.socket as a parameter

What is the best way to pass the net.socket class as an argument in this scenario? Here's my code snippet: this.server = net.createServer(this.onAccept.bind(this)); this.server.listen(this.port); } Server.prototype.onAccept = function () { // How c ...

Unable to bounce back from a stack overload

While learning Python, I created a small script that seems to run into a stack overflow error when the server disconnects. Here is my script: #/user/bin/python import os import socket import subprocess import errno import threading s = socket.socket() ...

Real-time chat functionality using Laravel 5.2, socket.io, and private messaging with redis

TLDR; Seeking best solution for private instant messenger integration with Laravel. I currently have a live real-time chat feature on my Laravel website, but I am missing the ability for private messaging. The chat is located on the home page and every ti ...

jspm hot reloading install - command not found following installation globally

I attempted to set up the hot reload module of jspm using the chokidar-socket-emitter. The installation process went smoothly, but I encountered an issue when trying to start the watch task as outlined in this guide: Below is the log from my installation: ...

Navigating Sockets with Navigator in React Native

Every time I encounter the error message undefined is not an object (evaluating this.props.socket.on). In my code, I define the socket in the index.ios.js file as shown below: class Main extends Component { constructor(props) { super(props); ...

What makes Redis the ideal choice for WebSocket communication?

I could really use some clarification on this topic. When it comes to Laravel and socket.io communication, Redis is the key component: https://laravel.com/docs/5.4/broadcasting#configuration My understanding is that Redis functions similarly to memcache ...

Using Socket.io with Node.js

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 ...

Node.js and socket.io come together in this collaborative text editing tool

I'm currently working on a collaborative app utilizing node and sockets that includes a simple text tool feature. My goal is for any user who types and applies text to the canvas to have that text visible to all other connected users. Here's wha ...

Error in Node.js Socket.io: The disconnect event is being triggered before the connect event

When the client reconnects after a network drop, the disconnect event is triggered on the server. Client code: var url ='192.168.1.101', port = '80', socket = io.connect('http://' + url + ':' + port, { &apo ...

Using the MERN stack in conjunction with Socket for MongoDB provides the ability to display real-time data on the frontend directly

As I work on setting up a website using the MERN stack, my backend will continuously fetch data from APIs and sockets to save it in a MongoDB database. For the frontend React, I aim to display and update this data in real-time using Socket. I have concern ...

steps for setting up socket.io client

Would it be possible to reference the socket.io client library using a relative path like: src="/socket.io/socket.io.js" instead of the absolute path: src="https://miweb:6969/socket.io/socket.io.js" To establish a connection with the library, typically ...

The Fusion of Ember.js and Socket.io: Revolutionizing Web

I have been trying to incorporate a basic Ember application into the view of my node application. I have verified that Ember is properly set up and my sockets are functioning correctly. However, I am encountering an issue where the data is not being displa ...

Advancement in the processing time of a HTTP response that is significantly prolonged

I am seeking a way to return an array of JSON objects (requested by an AJAX call in an AngularJS web application) that represent specific files on the server implemented with node.js. Typically, the result is quickly accessed from a database. However, if ...

Dual Socket.io connectivity

Here's a simple question I have. I am running a Node.js server with the following code snippet: io.on('connection', function (socket) { console.log('connection'); }); On my webpage, I have this line of code: var socket = io(); ...

The delivery of messages sent through sockets.io is postponed until the completion of the post

One challenge I am facing is updating the progress bar while uploading and processing a file using multer in Node.js. Currently, the client only receives updates after the processing is complete, causing the progress bar to jump from 0% to 100% at once ins ...