Issue I am trying to make a simple chat app using vuejs and socketio. I would like to broadcast a message from one user to all the others. I have the following code on the server side to do that:
Continue readingTag: socket.io
[SOLVED] UseEffect would run more than one time in ReactJS
Issue The useEffect would run more than once for some reason (usually twice) and would print my message twice (or more). I have tried multiple solutions even with useMontainEffect but the result is always the same. Any solutions? import ‘./App.css’;
Continue reading[SOLVED] apache node js socket.io error connection refused
Issue There is a php-file on apache: <script src="/../node_modules/socket.io/client-dist/socket.io.js"></script> let socket = io.connect( ‘http://localhost:3000’ ); socket.on(‘update’, function updateData(sounds) { console.log(sounds); }); and node js in same directory let http = require(‘http’); let express = require(‘express’); let path = require(‘path’); let
Continue reading[SOLVED] Fastify & Socket.io CORS not accepted
Issue I’m tring to set up fastify-socket.io, fastify-cors, but I’m still getting CORS errors. I have fastify-cors and fastsity-socket.io registered Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://localhost:5000/socket.io/?EIO=4&transport=polling&t=NoUUJ6g. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing). Here
Continue reading[SOLVED] socket.io not working in production mode for IOS?
Issue I’m currently using socket.io for real time alerts in my app. I’m developing it using React Native with Expo. I import this instance of the socket into required components: socketInstance.js import io from ‘socket.io-client’; import { url } from
Continue reading[SOLVED] 400 bad request on socket connection hosted on amazon application load balancer
Issue Background I am working on kong admin to connect to kong api gateway I am using the docker file provided by the kong admin. Problem The docker container is working fine on my local machine and the UI is
Continue reading[SOLVED] ESP32-CAM fastest way to stream video output to nodejs server with socketIO
Issue I would like to stream video camera from ESP32-CAM to web browser. To do so, I use a nodejs server (to broadcast video and serve html) and SocketIO to communicate (between ESP32-CAM -> nodejs and nodejs -> web browser).
Continue reading[SOLVED] Socket.io – listen events in separate files in node.js
Issue For example my idea is: File1.js io.sockets.on(‘connection’, function (socket) { socket.on(‘file1Event’, function () { //logic }); }); File2.js io.sockets.on(‘connection’, function (socket) { socket.on(‘file2Event’, function () { //logic }); }); This code is for a node server, will I have
Continue reading[SOLVED] Socket.io multiple pages
Issue I’m trying to create a chat using socket.io, I’m having a problem. I want to know if it is possible to reuse my socket.id in my different pages of my project to not lose the connection of my socket?
Continue reading[SOLVED] Change request headers SOCKET.IO (without disconnecting and reconnecting)
Issue I’m setting request header while establishing connection to my Socket.IO server like this: /* Socket.IO client */ let socketIO = new SocketIO("http://localhost:8080", { extraHeaders: { accessToken: "access123", refreshToken: "refresh123" } }); How can I change the header after the
Continue reading