Questions tagged [socket.io-client]

65 questions
0
votes
0 answers

Socketio emit and on is not working properly in NodeJS

Socket io.on is not working in NodeJS. Front End - Angular 14x socket io version - "socket.io-client": "^4.5.4", BackEnd - Nodejs 14x socket.io version - "socket.io": "^4.5.4", FrontEnd Code - import SocketClient from 'socket.io-client'; export…
0
votes
0 answers

io.to(targetSocketID).emit() is there a way to emit to just sender and receiver

I'm trying to create a private messaging functionality using socket.io with React and Node. I am able to send a message to a particular socket like so: io.to(targetSocketID).emit('privateMessage' message) it successfully sends it to that specific…
0
votes
1 answer

socket.io client 's namespace invalid

I am running on the latest version of socket.io, the server code and client code below works well. // server const {Server} = require("socket.io"), http = require('http'); const httpserver = http.createServer(); io.on("connection", async (socket)…
user824624
  • 7,077
  • 27
  • 106
  • 183
0
votes
0 answers

Problem connecting a Socket.io client in a Unity3d project configured with MRTK2

hi, i'm trying to implement a socket.io client inside a unity3d project configured with mrtk2. Using the library recommended by Socket.io for a C# client I was able to establish the connection to the server, but as soon as I insert the code inside a…
0
votes
0 answers

How to add something to Companion that ignores websocket connections that are not intended for Companion in nodejs

I am setting up both a socket.io server and Companion’s uppy.socket() on the same http server instance. Companion doesn’t use socket.io so we can’t use socket.io-client to connect to it. If both servers are set up on the same http.Server instance,…
0
votes
0 answers

Handling Typescript Error - Socket connection using sails.io.js

I am using Sails with a react front end in Typescript. Previously, while trying to establish socket connection at the front-end, I was facing the below issue The provided socket.io client (io) has already been augmented into a Sails socket SDK…
SM1312
  • 516
  • 4
  • 13
0
votes
0 answers

Testing socket.io-client with Jest (React) - How do I simulate an event from the server?

I built a simple React app that has a list component, together with another component that has a text input and a button. When You add text in the input and click the button, that text is added to the list. The app has a Node.js backend which…
udidol
  • 11
  • 5
0
votes
0 answers

Save data outside of callback in socket.io

All I want to do isclient1 =(1)=> server =(2)=> otherclient =(3)=> server =(4)=> client1 however data cannot pass in =(4)=> back to the requester server (node.js socket.io) ` var data1 = ""; socket.on("getdata", async(postid,cb)=>{…
Hey
  • 11
  • 3
0
votes
0 answers

Socket.IO-Client in angular not receiving all the messages sent by server(Kafka-consumer) node.js

I am building an Apache Kafka application where Producer (built on Dotnet Api) successfully published 90,045 messages to topic and Consumer (Built on Node.js) has received all of them. But when consumer is sending those messages to Angular UI…
0
votes
0 answers

Problem with implementing Laravel echo in websocket

I'm struggling with implementing Websocket on Laravel. I'm using laravel-echo-server on the server side. I have some notifications that I want to send with Websocket and then get on the client-side with Laravel echo. I'll write down what I've…
0
votes
0 answers

how to connect socket.io server using socket.io client cpp

I'm trying to connect to the socket.io server that is using parser. The following code connects well to server. export const connect_push_socket = createAction(CONNECT_SOCKET, () => { const socket =…
Trinity
  • 1
  • 1
0
votes
1 answer

HTTP request with socket.io

Is there a way to perform GET and POST requests using only socket.io-client? Regardless of the server framework. Something like socket.emit('/endpoint', req).
0
votes
0 answers

While installing an NPM socket.io-client occured several problems I cannot solve

I wanted to install npm package socket.io client, so in my directory I run npm install socket.io-client, and when it's done I get this message in Terminal : user$ npm install socket.io-client up to date, audited 1377 packages in 10s 210 packages…
tresor13
  • 57
  • 8
0
votes
0 answers

Socket.io server not receiving custom headers send from socket.io client connection

Below is my code to make socket connection by using socket.io. The problem with the following code is I am not able to get customer header set with extraHeaders at server end. Nether socket.request.headers nor socket.handshake.headers` works for…
Rajan Twanabashu
  • 4,586
  • 5
  • 43
  • 55
0
votes
0 answers

Socket.IO: Do Network Packets still get sent while Server Subscribes but Browser not Listening?

This is a question I can't seem to find an answer to easily. Related to socket.io If a client connects to socket server, and the server subscribes them to a room, but the browser client is not listening to the events from that room, does the network…
geilt
  • 807
  • 8
  • 9