Adrien Béraud
cdba5b33cc
proxy server: add options to listen route
2024-11-20 11:40:12 -05:00
François-Simon Fauteux-Chapleau
df189e3e12
dht_proxy_server: add push notification statistics
2024-11-05 15:13:39 -05:00
François-Simon Fauteux-Chapleau
792b851d77
dht_proxy_server: fix Android push notifications
...
This commit updates the format of the push notification requests sent by
the DHT proxy server to conform to FCM's HTTP v1 API. (The previously
used API was deprecated in 2023, see:
https://firebase.google.com/docs/cloud-messaging/migrate-v1 )
The "priority" and "ttl" (time to live) options are specific to Android
and therefore need to be put in the "android" block, as documented here:
https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages
2024-09-19 12:48:36 -04:00
Adrien Béraud
5a2a20a32f
http: migrate from http-parser to llhttp
2024-05-31 06:58:09 -04:00
Andreas Traczyk
c0a1356049
dht_proxy_server: use lambda instead of std::bind for listen callback
...
Avoids issues compiling with MSC.
Also move PushSessionContext definition outside the OPENDHT_PUSH_NOTIFICATIONS condition.
2024-04-04 14:20:01 -04:00
Andreas Traczyk
b40d604ef7
provide value IDs for push notifications
2024-04-02 17:34:16 -04:00
Lanius-collaris
f9b46168d0
dht_proxy_server: Allow user to specify non-standard ports in UnifiedPush endpoint
2024-01-17 15:54:04 -05:00
Adrien Béraud
601758f5fd
proxy server: use isMember for timeout
2023-09-27 13:56:43 -04:00
Kateryna Kostiuk
61f43c6b05
iOS: use high priority for resubscribe notifications
2023-09-18 15:27:41 -04:00
Adrien Béraud
fafd2f0233
update copyright year
2023-06-02 23:16:04 -04:00
Sébastien Blin
54eff3b0aa
proxyServer: no need for a pushServer_ for type==UnifiedPush
2023-06-02 13:18:58 -04:00
Adrien Béraud
9e60a681f3
use ostringstream instead of stringstream where possible
2023-03-23 16:50:19 -04:00
Adrien Béraud
4ce9292b28
proxy server: allow to ping push
2023-02-23 15:43:16 -05:00
Sébastien Blin
6e73a78a8b
unifiedpush: remove unifiedpush parameter
...
Because there is multiple unifiedpush endpoint (ntfy.sh is one),
we should not pass it as an option to dhtnode, but use the one
provided by the user in the token (from unified push library).
2022-12-30 20:36:49 -05:00
Sébastien Blin
b9ccc968b2
proxyserver: add support for UnifiedPush standard
...
Make the proxy able to support the UnifiedPush platform, so that
applications using the proxy server can use any UnifiedPush provider.
Documentation: https://unifiedpush.org/
How to test:
+ Install a UnifiedPush provider on a device (e.g. https://ntfy.sh )
+ Run dhtnode with a proxyserver and --unifiedpush https://ntfy.sh
+ Subscribe to a random topic on ntfy (e.g. "dhtproxytest")
+ Subscribe to a hash on the DHT:
curl -X SUBSCRIBE http://my.dht.proxy:8000/key/foo \
-d '{"key":"dhtproxytest", "platform":"unifiedpush"}'
+ Send data on the subscribed hash
Note: the topic should be completely random.
2022-10-11 15:14:51 -04:00
Sébastien Blin
7e33c4fc76
dht_proxy_server: fix push notifications if tls is enabled
...
If the proxy got TLS enabled, this doesn't mean that the REST
endpoint for push notifications is also using TLS.
Also, fix an incorrect log.
2022-10-11 11:54:37 -04:00
Adrien Béraud
39bb520339
proxy server: don't send refresh notification for non-push operations
2022-09-22 12:46:54 -04:00
Sébastien Blin
18e53b9ec8
proxyserver: send correct value id to client
...
when searching for a value to put, the proxy server returned
a json with value->id = 0, causing the client to not refreshing
correctly the values later (when timeout-ing, the value to refresh
is not found).
2022-09-15 11:45:11 -04:00
Sébastien Blin
b800012c57
proxyserver: add topic to msgpack
2022-09-08 11:15:28 -04:00
Sébastien Blin
ebeff20215
dht_proxy_server: fix permanent put
...
When a second permanent put request was received, we didn't call
async_wait after changing the expiration, causing push to not be
sent the second day and presence to expire on some devices after
~3 days.
2022-09-07 16:47:37 -04:00
kkostiuk
0f8d891476
iOS: drop support for voip notifications
2022-07-25 15:26:57 -04:00
Adrien Béraud
577f2a0645
proxy server: allow to configure address to bind
2022-07-05 19:32:29 -04:00
Adrien Béraud
293662a710
proxyserver: cleanup, avoid ref-to-temporary
2022-07-05 12:16:41 -04:00
kkostiuk
ead21d24a0
proxyserver: add application bundle id option
2022-07-04 18:17:12 -04:00
Adrien Béraud
633a03d76a
ios: support multiple notification types
...
- VOIP notifications for iOS < 14.5
- alert and background notifications for iOS >= 14.5
2022-06-30 15:44:16 -04:00
Adrien Béraud
f9b2285593
use string view literals where relevant
2022-03-29 14:47:01 -04:00
Adrien Béraud
9c2268fa41
fix various cppcheck warnings/errors
2022-03-29 10:15:00 -04:00
Adrien Béraud
21a71b1559
proxy server: support c++17
2022-03-23 13:35:30 -04:00
Adrien Béraud
c59f951e5a
update copyright
2022-03-10 19:51:25 -05:00
Sébastien Blin
2a50f85a30
proxy_server: set expiration for iOS devices
2021-09-10 10:21:31 -04:00
Sébastien Blin
04a78445c6
dht_proxy_server: increase ttl for push to 24 hours
...
If the android device is offline during more than 10 minutes, it
can misses push notifications and cause an incorrect state with
values not expired even if the re-subscribe is correct.
2021-09-10 10:21:31 -04:00
Adrien Béraud
0c00544798
remove embedded argon2, HTTP_PARSER_FORK
2021-06-09 13:57:10 -04:00
Sébastien Blin
ad549098f8
proxyServer: use lockListener_ to protect pushListeners_
2021-05-25 16:05:03 -04:00
Adrien Béraud
2195c0ed3e
proxy server: allow build without push notification support
2020-05-24 14:11:13 -04:00
Adrien Béraud
1b7e0679d5
proxy server: check push token when loading state
2020-05-24 02:04:45 -04:00
Sébastien Blin
9292c1116c
proxy: count permanent put values by hash in stats
2020-05-24 01:25:31 -04:00
Adrien Béraud
e3cd2a9d02
proxy server: add missing listener type
2020-05-19 19:52:51 -04:00
Adrien Béraud
19ccc3a327
proxy server: restart timers on resubscribe
2020-05-19 19:50:20 -04:00
Adrien Béraud
a27815b4a9
proxy server: persist ops on disk
2020-05-19 19:50:20 -04:00
Adrien Béraud
5daaf372b4
proxyserver: generate id before put
2020-05-11 12:31:07 -04:00
Adrien Béraud
1c536cbf5e
permanent put: set clientId
2020-02-09 10:34:42 -05:00
Adrien Béraud
859d8dc9cf
proxy server: check clientId for merging put
2020-02-07 00:21:13 -05:00
Sébastien Blin
1a67140463
proxyserver: enable keep alive packets
2020-02-06 14:15:47 -05:00
Adrien Béraud
9ae3d3c4d4
proxy: move info if possible
2020-02-05 14:25:03 -05:00
Sébastien Blin
5cfcf4861d
proxyserver: set permanent put pushToken
2020-01-28 16:27:20 -05:00
Adrien Béraud
7791163d49
proxy: receive values in blocks
2020-01-22 16:02:26 -05:00
Adrien Béraud
56db1bba19
proxy server: merge identical put requests
2020-01-22 15:56:48 -05:00
Adrien Béraud
fc95c85983
proxy server: send values in batches
2020-01-22 13:15:37 -05:00
Adrien Béraud
5af0f0c3d0
proxy server: flush response after all values are sent
2020-01-19 14:32:57 -05:00
Adrien Béraud
ec8beec427
proxy server: update stats on startup
2020-01-19 14:32:57 -05:00