Commit graph

52 commits

Author SHA1 Message Date
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
RobinLinus
0731a21d68 Cancel keep alive on join room 2018-09-21 20:09:49 +02:00
RobinLinus
61697d3abc Cancel keep alive on join room 2018-09-21 20:01:59 +02:00
RobinLinus
b67afca8ac Cancel keep alive on join room 2018-09-21 19:54:16 +02:00
RobinLinus
23e7c04393 Network fixes 2018-09-21 19:51:29 +02:00
RobinLinus
663db5cbb3 Version 2 initial commit 2018-09-21 16:05:03 +02:00
Robin Linus
c962909c0e Cleanup unused files 2016-06-22 15:02:44 -06:00
Robin Linus
e66598d77f Squashed commit of the following:
commit dd00d53895b824fbe4170c4a34b104303f722ccd
Merge: 2b3698e cb9ea12
Author: Robin Linus <robin_woll@capira.de>
Date:   Wed Feb 10 00:27:32 2016 -0600

    Merge branch 'name-device' into merge123

    # Conflicts:
    #	app/elements/buddy-finder/buddy-avatar.html
    #	app/elements/buddy-finder/buddy-finder.html
    #	app/elements/buddy-finder/personal-avatar.html
    #	app/index.html

commit cb9ea1235001f0cc23514cb622ce711cdc0538af
Author: Robin Linus <robin_woll@capira.de>
Date:   Tue Feb 9 23:43:49 2016 -0600

    #13 Feature Request: Name your device

commit 6fa43b56f4e705a19e68b62bc671a4948b6968fb
Author: Robin Linus <robin_woll@capira.de>
Date:   Fri Jan 1 19:54:56 2016 +0100

    Initial

commit fc55c86f5cf95039355d85be7409e68f27246696
Author: Robin Linus <robin_woll@capira.de>
Date:   Fri Jan 1 18:06:27 2016 +0100

    Fix fullscreen layout on iOS
2016-02-10 08:58:09 -06:00
Robin Linus
6a940acad2 Use JSON.stringify instead of toString 2015-12-30 23:47:28 +01:00
Robin Linus
1bce467a7c Notify clients only if buddies change 2015-12-30 16:54:18 +01:00
Robin Linus
b66340e1dd Notify clients only once of empty buddy-list 2015-12-28 23:02:29 +01:00
Robin Linus
bd3103a2fe Minor server performance improvements 2015-12-28 05:58:49 +01:00
Robin Linus
bda1a15750 first working version 2015-12-26 13:33:16 +01:00