Category : socket.io

I’m trying to make a tcp connection from Angular 11.2.5 to a local device that only accepts TCP connections. When I use the net package in Node, I can make a successful TCP connection to the device. Since that package is not available in Ng, I tried using the socket.io-client v4.0.1 package for Ng, but ..

Read more

I have my server in python from flask import Flask, render_template, jsonify from flask_socketio import SocketIO, emit app = Flask(__name__) socketio = SocketIO(app, cors_allowed_origins="*") import time @socketio.on(‘connect’) def test_connect(): emit(‘data’, {"tag" :"message"}) value_changed() def value_changed(): emit(‘data’, {"tag" :"message"}) time.sleep(3000) while True: value_changed() if __name__ == ‘__main__’: socketio.run(app, host=’0.0.0.0′, port=3000) I have my client code running ..

Read more

This may be a duplicate question but I have tried everything but couldn’t make it work. I have an Angular 10 web application + Node.js server. Here is the server code: public listen() { const { SERVER_PORT = 3000 } = process.env; const { SERVER_ROOT_URL = "http://localhost:${SERVER_PORT}" } = process.env; let http = require(‘http’).Server(this.app); const ..

Read more

I’m seeing an issue where when I have GraphQL and socket.io running on the same NestJS API server, socket.io will not connect with websockets, it only establishes a connection with long polling. if I comment out the import for my GraphQL in my app.module, I’m able to connect with a websocket transport protocol. I assume ..

Read more

In my vps Linux Ubuntu I have a chat that works almost perfectly, it sends and receives messages correctly. Apparently everything works fine, but when I open the console I see errors referring to socket.io. My socket io verion of my backend is "socket.io": "^ 2.1.1", and I use angular 8 polyfills-es2015.39e6a31b601b9b3913c6.js:1 GET http://localhost:3000/socket.io/?EIO=3&transport=polling&t=NYHZH0I net::ERR_CONNECTION_REFUSED ..

Read more