Questions tagged [socket.io-client]

65 questions
1
vote
0 answers

socket.io-client: Get handshake headers

In order to preserve session across reconnections (using express-session), I'm trying to access the headers of a handshake. I couldn't find any way to access them (the client API completely ignores the handshake). My idea is to use the handshake…
Itay Ganor
  • 3,965
  • 3
  • 25
  • 40
0
votes
0 answers

I got problem with the socket.io-client not connecting to the server

I can't connect to the server with socket.io-client here is how I import socket.io-client import io from "socket.io-client here I try to connect to io: const socket = io("http://localhost:3000") then I tried to console log some stuff useEffect(() =>…
0
votes
1 answer

Refused to load the script socket.io

Refused to load the script 'https://cdn.socket.io/4.5.4/socket.io.min.js' because it violates the following Content Security Policy directive: "script-src 'self'". Note that 'script-src-elem' was not explicitly set, so 'script …
0
votes
0 answers

I can see the emitted and received messages in the console tab but not the network tab

So basically I made this simple client code const socket = io('wss://rapidbus-socketio-avl.prasarana.com.my'); socket.on('connect', () => { console.log("connected") …
Exboy
  • 79
  • 7
0
votes
1 answer

How can I implement global messages with Socket.io-client?

I succesfully implemented a real-time chat in specific 'room' with Socket.io-client. And now, I want to make every message from every room make an alert from everywhere in my page even though the user doesn't actually enter every room. So, I wrote…
Ha_AH
  • 1
  • 1
0
votes
0 answers

Why my websocket connection is not sending request?

I'm trying to create socket connection like that: const socketConnection = yield call(io, 'ws://localhost:8000', { agent: false, timeout: 1, // 1 ms reconnection: true, transports: ['websocket', 'polling'], upgrade: false, …
0
votes
0 answers

Node.js Socket.IO client doesn't connect to the netty-socketio Spring Boot Socket.IO server

I'm facing an issue with setting up Socket.IO for a project. I'm using Spring Boot with the netty-socketio (V2.0.3) dependency for my socket server. It supports 1.x - 4.x versions of Socket.IO clients, as per the release documentation. The server is…
0
votes
0 answers

My react app isn't working with socket.io-client. What should I do to fix it?

i have a react app that's supposed to get data from the server and act accordingly. I am using socket.io-client and it isn't working when i call socket.on() socket.js (client side): import constants from '../constants'; import openSocket from…
0
votes
1 answer

sails.io.js with Svelte3/4 SvelteKit

I've been trying to port my app from older Svelte3/Rollup to newer Vite based setup and am having trouble initializing sails.io.js client to work inside Svelte. What used to work really well in the past with Svelte3/Rollup was: Inside…
Eximorp
  • 331
  • 4
  • 11
0
votes
1 answer

Simple-peer: Video Calling App not working when peers are connecting from different systems

I have built a video calling app that enables video communication between two peers. When I open the site (hosted on Surge, server hosted on render.com) on a single system with two different tabs corresponding to local peer and system peer, I am…
0
votes
0 answers

can i use multiple socket connection in same device with backend?

can i use multiple socket connection ? is it normal ? frontend : Android Java backend : Nodejs issue : socket is disconnect after sometimes. i tried many ways to connect stable . case : when user open app so they connect "globalRoom". [ for transfer…
0
votes
0 answers

messages in nextjs are not setting up with socket io

i'm trying to create a simple chat. i made a customhook to handle connection with socket io import { useEffect, useState } from 'react'; import { io, Socket } from 'socket.io-client'; export type Message = { author: string; msg:…
Luis Paulo
  • 54
  • 4
0
votes
0 answers

I want to implement Sockets in NextJS api route, listen events & emit them on frontend in NextJS/React component. Client<-->Api route <-->Server

In the Backend There is a server, which will create socket. In frontend, React component uses a fetch api from NextJs api routes to contact backend. I want nextjs api route to emit events to frontend, after server emits them & show the output. My…
Rohit
  • 1
0
votes
0 answers

Socket.io emitting multiple events in React.js

I am new to React.js and Socket.io. After learning a few basics of React, I wanted to build a simple real-time communication app. I followed this YouTube video tutorial (https://www.youtube.com/watch?v=jD7FnbI76Hg&t=1339s) by Traversy Media on how…
0
votes
1 answer

Socket.io communication issue from client, though works via Postman

I have a web client (Angular) that after deployment to production fails to get any messages from a Socket.io server. It uses connect('https://myserver.com'). The odd thing is, I have no problem connecting and communicating for the same address via…
vitaly-t
  • 24,279
  • 15
  • 116
  • 138