[GH-ISSUE #652] Android: Add Rate-Topics: header to UnifiedPush subscriptions #484

Closed
opened 2026-05-07 00:24:40 +02:00 by BreizhHardware · 3 comments

Originally created by @binwiederhier on GitHub (Mar 3, 2023).
Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/652

For UnifiedPush topic subscriptions, we need to add a header Rate-Topics: ... to the JSON stream and WebSocket Connection, so that the server can rate limit based on the subscriber. Right now, this is done solely based on the topic name up<12 digits>, which was meant to be temporary.

Originally created by @binwiederhier on GitHub (Mar 3, 2023). Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/652 For UnifiedPush topic subscriptions, we need to add a header `Rate-Topics: ...` to the JSON stream and WebSocket Connection, so that the server can rate limit based on the subscriber. Right now, this is done solely based on the topic name `up<12 digits>`, which was meant to be temporary.
Author
Owner

@binwiederhier commented on GitHub (Mar 3, 2023):

/cc @wunter8 While you're in the Android codebase 😬

<!-- gh-comment-id:1454008145 --> @binwiederhier commented on GitHub (Mar 3, 2023): /cc @wunter8 While you're in the Android codebase :grimacing:
Author
Owner

@wunter8 commented on GitHub (Mar 3, 2023):

Haha, I'll see if I can get to this over the weekend. What exactly am I doing, though?? Is there a Discord/Matrix thread I should refer to for context?

<!-- gh-comment-id:1454020166 --> @wunter8 commented on GitHub (Mar 3, 2023): Haha, I'll see if I can get to this over the weekend. What exactly am I doing, though?? Is there a Discord/Matrix thread I should refer to for context?
Author
Owner

@binwiederhier commented on GitHub (Mar 3, 2023):

Basically, you're listing all UnifiedPush topics in the GET request for the subscription connection, e.g.

# HTTP stream
GET /mytopic,up1234567890,backups-yolo,up11231323/json HTTP/1.1
Rate-Topics: up1234567890,up11231323

# Websocket
GET /mytopic,up1234567890,backups-yolo,up11231323/ws HTTP/1.1
Rate-Topics: up1234567890,up11231323

# Polling
GET /up1234567890/json?poll=1 HTTP/1.1
Rate-Topics: up1234567890

This will tell the ntfy server to register visitor as a rate visitor for the UP topics, but not the others. I am happy to give more details, but this is poorly documented, as it is still be ironed out.

<!-- gh-comment-id:1454026517 --> @binwiederhier commented on GitHub (Mar 3, 2023): Basically, you're listing all UnifiedPush topics in the GET request for the subscription connection, e.g. ``` # HTTP stream GET /mytopic,up1234567890,backups-yolo,up11231323/json HTTP/1.1 Rate-Topics: up1234567890,up11231323 # Websocket GET /mytopic,up1234567890,backups-yolo,up11231323/ws HTTP/1.1 Rate-Topics: up1234567890,up11231323 # Polling GET /up1234567890/json?poll=1 HTTP/1.1 Rate-Topics: up1234567890 ``` This will tell the ntfy server to register visitor as a rate visitor for the UP topics, but not the others. I am happy to give more details, but this is poorly documented, as it is still be ironed out.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ntfy#484
No description provided.