gotify / server

A simple server for sending and receiving messages in real-time per WebSocket. (Includes a sleek web-ui)
https://gotify.net
Other
10.43k stars 593 forks source link

[FEATURE REQUEST] Multiuser support on WebSocket #623

Closed androidseb25 closed 5 months ago

androidseb25 commented 5 months ago

Since i've created the iOS App, many of my users requested to me a multiuser support, but it's not possible without creating X WebSocket connections.

Is it possible to pass multiple clients in an array or something else to the WebSocket, to avoid the multiple connections?

jmattheis commented 5 months ago

What are the use cases for this?

androidseb25 commented 5 months ago

Many of my users use Gotify on a web host, e.g. Hetzner, and use their instance for both professional and private purposes, only with different user accounts. Therefore, they want to receive notifications for both accounts and not just one.

jmattheis commented 5 months ago

This doesn't sound like a common use-case. I mean you either separate it completely with different servers, or you don't really get a benefit from different users. It rather sounds like another feature to group messages by, like a tag or category.

GoWeasel commented 5 months ago

This doesn't sound like a common use-case.

in 2024 ?

let me think a moment, mqtt, reactjs, and tons of web api's are capable todo so, nearly every chat application tries to provide it, as mostly common use case (in my point of view) is, that you have business and private account on same phone, instead of using two devices.

jmattheis commented 5 months ago

In gotify/android there are requests for multisserver support and multi-user features like sharing applications, but as of now the need for multiple users on the same server wasn't proposed. Therefore, I see this feature as not a common use case in the Gotify context.

let me think a moment, mqtt, reactjs, and tons of web api's are capable todo so

This seems like a bad comparison to me; these are libraries and not end products that are visible to the user. You could even list Gotify there. Gotify supports getting messages from multiple users, but not via the same web socket connection. Security-wise, this also seems not that great, because now you have two authenticated users for one request.

nearly every chat application tries to provide it, as mostly common use case (in my point of view) is, that you have business and private account on same phone, instead of using two devices

I understand the chat example, but I'm not sure if this fully applies to Gotify. You can already separate business and private messages via applications in Gotify and the addition of multiple users seems really similar to this.


@androidseb25 I think in this case, multiple websocket connections aren't an issue. Gotify can easily handle thousands of websocket connections without problems. If you're using a websocket client with http/2 support (+ http/2 supporting reverse proxy), then multiple websocket connections are likely multiplexed over a single http2 connection.

In the context of iGotify the overhead of multiple websocket connections is negligible because it is happening in the iGotify-Notification-Assistent and likely doesn't increase the data usage of the end device. Concluding, I don't really see the need for this feature as it's currently proposed. Or are there any concrete problems with having multiple connections for multiple users to the same server?