Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add fallback port #12

Open
Tienisto opened this issue May 14, 2023 · 3 comments
Open

Add fallback port #12

Tienisto opened this issue May 14, 2023 · 3 comments

Comments

@Tienisto
Copy link
Member

The current default is to use port 53317, however, there is a small probability that this port is used as "ephemeral port". (See localsend/localsend#125)

A solution for this is to add a fallback port if 53317 is already occupied.

The fallback port should be a lower-number port which will be upgraded to default in another future release.

I really liked your way of thinking @Jipok. What do you think ? Do you know of any good port?

@Jipok
Copy link

Jipok commented May 16, 2023

Well, with ports you can never be sure that there will be no conflict. Even if you find some wonderful list of absolutely all ports, then tomorrow a new program may appear and use your port. But you have to choose and I would recommend iana's list and pick something that isn't used. Or vice versa, choose an already used port with something that will obviously never be used on the same machine as localsend. You can also try to work on two ports at the same time, in addition to backward compatibility you will get increased reliability.

@Tienisto
Copy link
Member Author

Well the problem is the discovery part. Currently, LocalSend listens to port 53317 for UDP packages (Other devices will say "hello" to that port).

From my experience and also according to some github issues, UDP may not work at all. In this case, LocalSend currently fallbacks to the classical approach and makes an HTTP request to every member of the local network.

In both situations, both parties (sender and receiver) need to know what port should be used. That's why LocalSend has a default port but the user can change this port to satisfy the environment constraints.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@Jipok @Tienisto and others