Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [websockets]

WebSocket is an API and a protocol for bi-directional, full-duplex communication that is closely associated with HTML5 and implemented in recent versions of most web browsers.

0
votes
0answers
24 views

How do I choose the right Websocket API

I'm doing a project where I have to control a live DALI controller and I'm sending data from the website to the controller with Websocket. How do I know what Websocket to use? At the moment I'm ...
-4
votes
0answers
30 views

Grpc vs IPC? Fastest way to have two processes communicate? [closed]

If I have a central process running on a machine, and potentially several other processes running into that same machine that need to communicate with the central process as fast as possible, how ...
-1
votes
0answers
31 views

Using Websockets with RESTful API

I've seen many apps use two separate servers to handle traffic. These services have a RESTful HTTP api server AND a websocket gateway. I guess I'm not sure how the websocket gateway interacts with ...
0
votes
0answers
10 views

Separate server for Flask-SocketIO chat functionality?

I currently have a Flask application which acts as the backend for my website. I intend to add live private chat functionality to my website using Flask-SocketIO. I was wondering, is it better to ...
1
vote
0answers
27 views

Difference between API server and Gateway

I'm working on a VOIP startup currently and deciding which software stack will be best. I'm doing a lot of research of how other people do it, like Discord. It's really hard to make some of these ...
0
votes
0answers
48 views

How do GraphQL subscriptions really work? Do they use web-sockets or http polling? [closed]

I would like to know the underlying technology that makes GraphQL subscriptions possible. I understand how the client is able to receive mutation updates but I want to know the underlying ...
0
votes
0answers
17 views

Live websocket updates of new likes / comments on streamed feed

I have a simple architecture where I push posts to topics, and where these posts are streamed to the user through a third party websocket provider (Ably). The architecture is simply: client -> ...
0
votes
1answer
55 views

Is there an equivalent to HTTP status codes for WebSockets messages?

I'm developing a WebSocket API and I was wondering if there was either a standard or best practice for responding to client messages. For example, if my API is expecting only stringified numbers but ...
2
votes
1answer
98 views

Resolving request congestion at browser by using socket as “fast lane”, any consequence?

I have received multiple reports from users of a Web-based GIS application we have rolled out one to two year ago, complaining the application becomes unstable/unresponsive. After a brief ...
0
votes
0answers
26 views

MQTT over WebSockets or custom protocol

I'm working on an event sourced web application. The backend is pretty simple and responsible only for maintaining the event log and delivering it to web clients, I'm using Haskell on top of Redis ...
0
votes
0answers
22 views

How do i structure my websockets to receive data from multiple exchanges?

I went through all the questions under the [websocket] tag and could not find anything and hence asking this question. I am trying to fetch real time ohlc tickers from multiple exchanges (10 for the ...
0
votes
0answers
31 views

Architecture of app that heavily uses web sockets

I am creating app that heavily uses websockets. The purpose of this app is for users to communicate with eatch others with numerous ways. Web sockets are used for this. I have never faces the ...
2
votes
0answers
84 views

Ensuring reliable delivery of messages over websockets?

I am building a comet service which will push new data to the client on mobile devices. For this, I am using websockets to deliver messages to the client. The problem I am facing here is the ...
1
vote
2answers
79 views

Is there a need to add web sockets for push notifications

Currently we have an application that, upon certain events, will send notifications to users. We use SQS to handle the actual delivery of the notifications. As an example, when a user registers an ...
1
vote
1answer
54 views

Architecture for communication between multiple backend systems and IoT devices via WebSockets

I have a scenario in which thousands of IoT devices -- each fitted with a sim card -- are geographically distributed and shall be controlled individually. Therefore each IoT device has a WebSocket ...
2
votes
0answers
168 views

Migrating a client from a REST API to a WebSocket one

I'm working on a system that integrates with several third party services via APIs. Those services require authentication. Usually, the services are implemented as REST APIs using HTTP. My system ...
1
vote
1answer
68 views

Design: HTTP and Websockets working together

I'm at a bit of crossroads here and I wanted to ask the opinion of the community. I am creating a chat application for our company. Now, like every chat application out there, the messages are saved ...
0
votes
2answers
181 views

Websockets vs ajax call for scheduled event?

Intro I have been weighing the pros and cons of using websockets vs an ajax call for an event which will happen every x number of seconds (in this case 5). I'll start by explaining the scenario. ...
6
votes
1answer
366 views

How long should Websockets maintain connection

I've created a rest generic service which additionally consume a websocket per resource my websocket code looks like so: initialize(hubSubRoute: string): void{ const accessToken = this....
0
votes
1answer
25 views

Evaluate http reqres vs websockets for geolocation based broadcasts

My use case is that I have a real-time broadcast app where users get feed items based on a geolocation, i.e. a user will receive posts that were broadcasted from within a user-defined radius where (s)...
0
votes
0answers
56 views

Should/Could I add MQTT to this design?

As a project for my university (having to be course-related), I came up with a system which would allow for device management over a HTTP/TCP connection. It would have: "N" number of devices with ...
3
votes
1answer
54 views

Realtime Live Auto updates for web applications

It's about trying to understand the architecture behind how updates to web application is done. I've been working on a non-public website that has bunch of records displayed in a UI, now the ...
1
vote
0answers
314 views

Are AJAX calls fully replaceable by requests sent via WebSockets?

I am redeveloping an application with the aim of going along with the more modern techniques. That is how I came across Socket.io, which I integrated with express.js. I implemented live searching ...
1
vote
2answers
833 views

WebSocket Client as an always running service

The company with which we are integrating is a door security company that makes RFID cards and door scanners. You scan your card, the door opens and lets you in. They allow 3rd party integration via ...
0
votes
1answer
40 views

Efficiently broadcast user status

This turned out to be a rather interesting problem contrary to my expectations. Imagine a simple chat app, a user registers then can add other users to their contacts list and start conversations. I ...
3
votes
0answers
397 views

Any disadvantage to using websockets for non-web client apps?

this is my first post on here. I am wondering if there is any disadvantage to using websockets as a communication method for a non-web-based client application to connect to a server? I am looking at ...
-3
votes
1answer
67 views

Best Data Structure for ordered list of connected users

I have three attributes for a user: connectionId (e.g. "sd4-h4sdg-u4j-a2rr3"), userName, and placeInLine. I can't think of a single data structure that will handle my scenario of only allowing a ...
1
vote
1answer
382 views

Multiple API calls potentially spawning multiple Websockets - Threading vs Async

I am designing a program with the flow as outlined below. Note, these are all network calls, there is no system I/O (hard drive). Initially, multiple independent API calls need to happen - they don'...
4
votes
2answers
4k views

What is the point of rooms in socket.io?

I was wondering what the purpose of rooms is. See: https://socket.io/docs/rooms-and-namespaces/ You can basically mimic join and leave with just socket.on and socket.off Take for example: (no room) ...
2
votes
1answer
98 views

Need advice on how to transfer data between two backend systems

I've been working on implementing a customer-facing REST API at work the last few weeks. Although there's not yet a requirement for it, I think it'd be really nice to have analytics for this. For ...
-1
votes
1answer
1k views

Does Web Socket block thread while keeping connection as regular http connection does?

Let's take Spring web socket (with tomcat) for example. Does Web Socket blocks thread while keeping the connection between server and client? (For example, connection can last 2-3 hours). ( Does web ...
2
votes
1answer
809 views

Battery Impact: Idle vs Busy Websocket on iOS [closed]

I’m wondering whether a busy websocket connection uses significantly more battery on iOS than a sparsely utilized one - or if there is a constant overhead simply for maintaining the connection that ...
0
votes
2answers
400 views

Communicate between browser and client application on localhost

I'm currently developing a Website that requires direct access to the client computer. Therefore I decided to split this project in this three main parts. There are some requirements that have to ...
3
votes
1answer
70 views

Should a push hold data or make the receiver trigger an API call?

With WebSockets, when clients should be notified that data changed, I've seen two approaches: the server pushes the data modifications directly within the push; or the server pushes no data, and the ...
0
votes
0answers
518 views

Node.js server game using socket.io architecture

I'm designing a multiplayer game using Node.js and the socket.io library to communicate with my clients. Basically, all clients connect to a the same lobby (specific socket.io namespace) where they ...
2
votes
0answers
218 views

Where do I put WebSocket handling code following the MVP pattern?

I am currently working on a Web Application. One of the objectives is to use the MVP (Model View Presentation) Design Pattern. We would like to use WebSockets to communicate between client and the ...
2
votes
2answers
705 views

Socket on a webserver

So what I know about socket is that a socket is an end point of a connection for a process, hence 1 socket on a host binds to an IP and a unique port number for each connection. But a webserver (by ...
1
vote
1answer
120 views

Performance: Looping on data on the server or getting data looped on clients via socket connection

I have a web application the mobile app users are connected it by using websocket. The server has data A that can be changed in time. And the clients (mobile app) have data B that also can be changed ...
1
vote
0answers
223 views

Best practice to maintain 2 servers - PHP and NodeJs

We have a Symfony backend server for our Android and iOS application. Recently we need to extend our application by supporting real time interaction such as chatting, and we decided to use NodeJs with ...
2
votes
0answers
510 views

Long lived connections

I have a custom non-blocking I/O server that supports (among other things) HTTP and websockets. I have two timeout concepts for connections: idle: connections that don't do anything are closed after ...
1
vote
2answers
549 views

Arbitrary protobuf message as byte-array over Websocket - how to determine actual message type upfront

Protobuf is nice and dandy, but it was not made with self-description in mind. Now this is totally okay if you're using a well-defined protocol and want to replace e.g. SOAP-messages or just want to ...
-1
votes
1answer
116 views

How to explain to a trainee how a computer receives external messages [closed]

I got a trainee in the company I work for. We are currently working on a JS interface that communicates through websocket with a C/Lang server. My trainee asked me a very good question this morning. ...
1
vote
1answer
817 views

bind() call in socket programming

I am reading about socket programming and got to know that ip is assigned to socket with bind() call before connection to server.Is my thinking of binding address means to bind any ip address correct.
-1
votes
1answer
2k views

Django and websockets: Channels vs Socket.io vs other?

In my Django web app I want to monitor my remote Raspberry PI clients - up to hundreds - using WebSockets: I have to check in their status in real-time (online, working, offline etc.), send commands ...
15
votes
2answers
7k views

How to architecture a realtime-heavy websockets-based web application?

In the process of developing a realtime Single Page Application, I have progressively adopted websockets to empower my users with up to date data. During this phase, I was sad to notice that I was ...
0
votes
2answers
467 views

How can an update message from a rabbitmq broker reach all relevant clients via multiple websocket servers?

Lets say I have multiple websocket servers that maintain many connections to clients to send updates. These websocket servers will be pulling said updates from a rabbitmq broker, and broadcasting them ...
1
vote
1answer
600 views

Deliver message to websocket client connected through load balancer

The problem I have a number of clients connected via websocket to nodes of my web application through a load balancer. What I need is to deliver notifications on a per-user basis. My idea My idea ...
3
votes
4answers
361 views

Does a full duplex communication object conflict with single responsibility?

I'm writing a Websocket implementation in Java, and I've set it up so that it basically just wraps an InputStream and OutputStream, and has public methods for both sending and receiving. While input ...
2
votes
0answers
517 views

How do I implement Socket.io Leaderboard using AWS Dynamo DB cost-effectively?

Every time a user submits a score, Socket.IO causes all the users get their leaderboard updated. This causes every single user connected through Socket.IO to read from the Dynamo DB database (every ...
2
votes
0answers
126 views

How to scale a slackbot app

I'm building an app for slack. While I've completed the POC, and everything works well for a single instance of the app, I'm having an issue of wrapping my mind around the scaling of it. The specific ...