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
Make your voice heard. Take the 2019 Developer Survey now

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.

-1
votes
0answers
43 views

Should I use a WebSocket or wait for the REST response? [closed]

We are developing a microservice architecture project. Once a request is sent to the backend from the frontend through a REST API call, our backend proceeds to apply various machine learning ...
1
vote
0answers
34 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 ...
0
votes
0answers
59 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
43 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
1answer
64 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
100 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 ...
2
votes
0answers
111 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
99 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
62 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
184 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
72 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
280 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
446 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
26 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
59 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
56 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
329 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
980 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 ...
1
vote
1answer
44 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 ...
4
votes
1answer
468 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
435 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
5k 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
102 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
974 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
462 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
550 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
232 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
849 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
123 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
228 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
536 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
580 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
1k 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
8k 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
497 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
645 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
391 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
543 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
129 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 ...
0
votes
1answer
327 views

A WebSocket API, reply message

I am writing a Web application for copying files between servers. I decided to write a WebSocket server which will receive and send relevant messages (that is communicate with a browser), start and ...
12
votes
1answer
9k views

RESTful HTTP and websocket in the same application?

If an application has already an opened WebSocket for live feeds, should I use it over AJAX for the other communications with the server? Because the connection is already opened, should we use it ...
1
vote
1answer
22 views

Keeping deploys in Sync

I plan to have a web server, which will serve JavaScript used to make connections, and a socket server which the javascript will talk to. How can I make sure that when deploying a new update, the ...
0
votes
1answer
379 views

User browser, WebSockets, server C#/MVC, game

Moving a windows desktop game to a web server based one. User will use a modern web browser and communicate with the server via WebSockets (SignalR). Server runs .Net4.5/MVC - ie stateless. Game ...
2
votes
1answer
2k views

Scaling websocket client connections (not server) to multiple servers

I wrote a Slack bot which must connect to Slack teams through websocket connections. Since the bot might be used by thousands of team, I will eventually need to distribute the teams across multiple ...
3
votes
1answer
424 views

Asynchronous socket.io for lots of concurrent messages

We have a web application which currently operates like this on a typical view/page: the front has to display 100+ "previews" (in the form of base64 images) each of this preview is built on-demand by ...