Commit graph

64 commits

Author SHA1 Message Date
schlagmichdoch
3b31472c52 Merge branch 'sw_digester' of https://github.com/schlagmichdoch/PairDrop into sw_digester 2024-07-14 23:32:44 +02:00
schlagmichdoch
fa86212139 Merge branch 'master' into sw_digester 2024-07-14 14:32:35 +02:00
schlagmichdoch
04d65da779 Fix substring error if remoteAddress is undefined and replace deprecated request.connection with request.socket (fixes #308) 2024-07-13 21:50:44 +02:00
schlagmichdoch
be381ea438 When switching public rooms disconnect from devices in old room (fixes #298) 2024-05-16 19:54:59 +02:00
schlagmichdoch
a5dc8b6da2 Split transfer into message and data transfer and rewrite FileChunkerLogic completely. Condense all Relaying of the Websocket Fallback into one message type 'ws-relay' 2024-02-05 21:08:06 +01:00
schlagmichdoch
c2ee459231 Fix error if env var RTC_CONFIG=false (as in default docker-compose.yml and docs) 2023-12-15 21:22:33 +01:00
schlagmichdoch
e06fa47c96 Implement customizable buttons via env vars (fixes #214) 2023-12-13 17:40:48 +01:00
schlagmichdoch
29bede6109 Fix setTimeout syntax 2023-12-08 13:57:19 +01:00
schlagmichdoch
a8242cecf7 Refactor URL arguments, localStorage and sessionStorage entries, and IndexedDB/PersistentStorage entries to snake_case. 2023-12-08 13:57:19 +01:00
schlagmichdoch
3439e7f6d4 Decrease redundancy by changing the way the websocket fallback is included; Adding new env var SIGNALING_SERVER to host client files but use another server for signaling. 2023-11-09 01:02:03 +01:00
schlagmichdoch
cb72edef20 Modularize server into multiple files 2023-11-09 01:00:07 +01:00
schlagmichdoch
3c07a4199b implement device pairing via 6-digit code and qr-code 2023-01-10 05:07:57 +01:00
schlagmichdoch
947e088aeb move files for node only implementation 2022-12-23 05:32:34 +01:00
schlagmichdoch
72f3bb0e7c fix small bugs - working version with turn server of relay.metered.ca 2022-12-23 03:28:39 +01:00
schlagmichdoch
f9a22e5ae4 Merge remote-tracking branch 'fork/customise_server_port' into add_device_pairing 2022-12-23 00:05:00 +01:00
schlagmichdoch
6fe348ab4b Merge remote-tracking branch 'fork/patch-1' into add_device_pairing 2022-12-22 23:52:44 +01:00
schlagmichdoch
39ee016875 Merge remote-tracking branch 'fork/fix-list-self-in-peers' into add_device_pairing 2022-12-22 23:51:22 +01:00
schlagmichdoch
3688ed0c98 put all devices on the same network as the server into the same room to make it possible to run snapdrop on the local network 2022-12-22 01:05:49 +01:00
Leonardo Scoppitto
0cd73f10ef
Check for CF-Connecting-IP and decreased timeout
When hosting Snapdrop behind Cloudflare, X-Forwarded-For is useless. Furthermore, I'm hosting my installation behind another internal proxy, so, in the end, X-Forwarder-For is set to the internal proxy's IP for all the peer, which can see each other regardless being on different networks. To fix this I made _setIP check if the header "cf-connecting-ip" exists, then sets the IP accordingly.

Lastly, when a peer changes network (e.g. a phone switches from wifi to mobile data), the function _leaveRoom is not called and the peer stays visible to others connected to the same room for a whole minute: I adjusted the timeout to what I think is a more reasonable value (500ms, so _leaveRoom is called after 1s).
2022-11-24 13:51:39 +01:00
MWY001
cb84bef2c2 Should not notify peer the existence of itself. 2022-11-05 00:35:55 +08:00
RobinLinus
2e0619fbba
Add error handler to ws connection 2022-10-13 15:20:38 +02:00
Matthew Gamble
a4d6cfd862
Allow selection of which network interface(s) to bind to
This is important for security reasons, as it allows someone to lock
down who can talk directly to the Snapdrop server. If someone wants to
run Snapdrop behind a reverse proxy (for example), it doesn't help if
someone can still talk directly to the Nodejs process.
2022-01-23 22:43:09 +11:00
RobinLinus
6150a48f29
Merge pull request #307 from RobinLinus/dependabot/npm_and_yarn/server/ws-7.4.6
Bump ws from 7.3.1 to 7.4.6 in /server
2021-06-04 15:38:04 +02:00
dependabot[bot]
67662453cb
Bump ws from 7.3.1 to 7.4.6 in /server
Bumps [ws](https://github.com/websockets/ws) from 7.3.1 to 7.4.6.
- [Release notes](https://github.com/websockets/ws/releases)
- [Commits](https://github.com/websockets/ws/compare/7.3.1...7.4.6)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-29 00:36:13 +00:00
dependabot[bot]
6a8ef47455
Bump ua-parser-js from 0.7.21 to 0.7.24 in /server
Bumps [ua-parser-js](https://github.com/faisalman/ua-parser-js) from 0.7.21 to 0.7.24.
- [Release notes](https://github.com/faisalman/ua-parser-js/releases)
- [Commits](https://github.com/faisalman/ua-parser-js/compare/0.7.21...0.7.24)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-06 21:07:26 +00:00
RobinLinus
fad4632eb9 Handle undefined device names - simplify + minor fix 2021-03-10 15:49:45 +01:00
RobinLinus
4b15aa0417 Handle undefined device names 2021-03-10 15:25:03 +01:00
RobinLinus
130f5391f8
Merge pull request #162 from LEXUGE/patch-1
Add support for SIGINT and SIGTERM handling
2020-12-22 17:55:37 +01:00
RobinLinus
7469086cda Combine browser name and unique name 2020-12-19 21:05:48 +01:00
RobinLinus
85dedf03ce Cleanup 2020-12-16 04:18:42 +01:00
RobinLinus
612d8cf1ea Use device type as display name
Pro:
- Device types are more descriptive.
- Device types don’t change after every reload

Con:
- Device types may not be unique.
2020-12-16 04:16:21 +01:00
Ying Kanyang (Harry Ying)
f9bace9a16
Add support for SIGINT and SIGTERM handling
Currently, server run by `node index.js` is not able to handle SIGTERM or SIGINT properly. The only fate is being killed. This change adds basic handling logic for these two signals, helping server to behave more properly as expected by many daemons and users.
2020-08-28 22:07:25 +08:00
Paul Szymanski
26fd1aade3 Set peerid cookie with SameSite=None; Secure 2020-07-16 14:00:21 +02:00
Paul Szymanski
4b1417224b Increase ws keepalive interval to 30 seconds 2020-07-14 02:34:13 +02:00
Paul Szymanski
150fdc8bc1 Change layout of peer name and remove unneccessary text 2020-07-13 23:56:58 +02:00
Paul Szymanski
10cfa962f2 Update unique-names-generator 2020-07-12 20:15:17 +02:00
Paul Szymanski
ff96b2446a Update ua-parser-js 2020-07-12 20:14:56 +02:00
Paul Szymanski
2c8dc9ed1d Update ws node package 2020-07-12 20:03:02 +02:00
Paul Szymanski
d89a92b217 Upgrade unique-names-generator 2020-07-12 14:52:26 +02:00
Mrigank Krishan
e7c484f428 show displayName on UI 2020-07-12 14:52:26 +02:00
Mrigank Krishan
0c7abfbf1d generate unique peer names
use unique-names-generator to generate peer names instead of relying on
UA. This prevents confusion when there are multiple clients on the network
with same UA.
2020-07-12 14:52:26 +02:00
PaulSzymanski
984d1e75ec Less logging 2020-03-24 15:23:20 +01:00
RobinLinus
993b484396
Don't crash when parsing malformed JSON 2019-05-29 21:35:39 +02:00
JBYoshi
cd221881b6
Make IPv4 and IPv6 localhost connections use the same room 2019-02-18 15:52:05 -06:00
JBYoshi
6de5e297d8
Revert "Make IPv4 and IPv6 localhost connections use the same room."
This reverts commit 8b99e921e7.
2019-02-18 15:47:21 -06:00
JBYoshi
8b99e921e7
Make IPv4 and IPv6 localhost connections use the same room. 2019-02-11 18:47:12 -06:00
RobinLinus
e9e8d6336b Refactor and cleanup 2018-10-09 15:45:07 +02:00
RobinLinus
0ede41f8d5 Cancel keep alive on join room 2018-09-21 20:34:49 +02:00
RobinLinus
1d9581632f Cancel keep alive on join room 2018-09-21 20:25:54 +02:00
RobinLinus
e71564a97c Cancel keep alive on join room 2018-09-21 20:15:55 +02:00