Questions tagged [Socket.io] (507)

0
answer

How to properly implement rooms using sockets?

Write online lottery, I want to create different rooms with limited rates and participants. Question. How to properly implement rooms? Actually that's a class game GameController.js: class GameController { constructor(timer, minBetPrice, maxBetPrice, maxAmount, room, port, socket) { this.bets = {} this.users = {} thi...
julio_Walter asked April 18th 20 at 13:00
1
answer

How to Docker using a socket.io right to designate ports for hosts and configure the CORS?

Good afternoon. There is a question - if the server and client on different ports in Docker, then is it possible to traverse the socket between them? There are 2 Services in docker-compose - frontend for Nuxt and backend NV Nodejs/Express/SocketIo. External ports Muppets on the inside. d8bface3deb4 app_frontend "npm run d...
Shana_Durgan90 asked April 18th 20 at 12:53
0
answer

How to overcome error "psycopg2.ProgrammingError..."?

Hi! I have always an error occurs psycopg2.ProgrammingError: execute cannot be used while an asynchronous query is underway As I understand it it's because I'm trying to use the data while the query is still not executed. how can I fix it? I use something like this, if you reduce the code to just a visual example: def wait(...
Tami asked April 18th 20 at 12:17
0
answer

How to make Socket.io to work with Vue?

Trying to configure Socket.io, but in the console instead of my desired messages get "vendors.101438627b8fbe2d3f90.js:25 POST localhost:3000/socket.io/?EIO=3&transport=polling&... 404 (Not Found)" Server Expressimport { Application, Request, Response } from 'express' const express = require('express') const path = ...
elmo asked April 16th 20 at 10:52
1
answer

How to test the sockets on the backend?

Hello, is there a program for testing sockets on the backend node.js as postman to test http requests?
lorenzo asked April 16th 20 at 10:52
1
answer

How to track changes in a mongoose model?

Hello I want to set the connection using sockets and send data from database to the client after every change. How to use mongoose I execute the function after each change to my collection
ward_Gottlieb asked April 16th 20 at 10:38
1
answer

Pitfalls in the development of chat. How to solve?

Write chat with node+socket.io. Writing for the first time. All manuals superficially describes the principle of message passing, but getting to implementation, I was faced with a few questions. Below the issues and solutions that came to my mind. A little bit about how I organized everything: The user is authenticated ...
Marlene.Raynor asked April 16th 20 at 09:58
2
answers

The creation dialogues Node.js and Socket.io?

I have a simple chat with the registration and authorization written in Node.js and Socket.io. At the moment I have only implemented a General chat for all registered users. All posts and users are stored in PostgreSQL. Now I need to do a private conversations between two users. So far I came up with only one idea how it c...
Clinton_Beahan asked April 9th 20 at 10:54
2
answers

It is normal that socket.io always writes to the log?

Privet! It is normal that in the console(while on test) are constant lines of the tipo 127.0.0.1 - - [27/Mar/2020 14:29:24] "POST /socket.io/?EIO=3&transport=polling&t=N4RmFef&sid=2865bf99d0d240a5b459595b2e925f2d HTTP/1.1" 200 - 127.0.0.1 - - [27/Mar/2020 14:29:41] "POST /socket.io/?EIO=3&transport=polling&a...
Carter80 asked April 9th 20 at 10:31
0
answer

How to connect socket io on the client side?

Can't solve this problem, there is the server and the client, the client can be on another server, and that this line is not working, I understand that I on the client side need to install a socket io via npm? What if there is the possibility of installing noda and npm on the client side
Huld asked April 8th 20 at 10:38