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

Option for forcing port to listen on #91

Closed
sashahilton00 opened this issue Jan 29, 2018 · 5 comments
Closed

Option for forcing port to listen on #91

sashahilton00 opened this issue Jan 29, 2018 · 5 comments

Comments

@sashahilton00
Copy link
Member

Issue by Robbiedobbie
Saturday Sep 23, 2017 at 11:11 GMT
Originally opened as plietar/librespot#253


Currently, librespot listens on 5353 and a random port. This makes running it on a pc with firewall difficult. It would be nice if there was an option to select a specific port instead.

I've never programmed in rust before, so I haven't made a PR for it. Currently locally I solved it by simply putting my port instead of 0 in the following piece of code: TcpListener::bind(&"0.0.0.0:0".parse().unwrap(), handle)?;.

@ComlOnline
Copy link
Contributor

Runtime flag to be added

--zeroconf-port <int>

@sashahilton00
Copy link
Member Author

This has been requested a few times, we should implement this as it's pretty trivial to do so. Runtime flag of --zeroconf-port suggested. Usage would be as follows: ./librespot --name "Librespot" --zeroconf-port 5353 one thing we must remember though is that any port number lower than 1024 are priviledged, so we should probably add some logic that rejects ports < 1024 and kicks out a warning that their chosen port has been ignored, then let the OS choose as it already does.

@michaelherger
Copy link
Contributor

michaelherger commented Jan 30, 2018

In addition to allowing specification of the port to listen on, librespot should not die if it fails to open that port. IMHO an error message logged should be good enough.

(adding "mdns" to this comment as I keep searching for it and don't find this report :-))

@michaelherger
Copy link
Contributor

mdns is implemented using @plietar's own https://github.com/plietar/rust-mdns. I tried to change port by changing the hard-coded value in there to 5354. Unfortunately the Spotify client would no longer see it, as if it was expecting the service to run on 5353 and nothing else.

@sashahilton00
Copy link
Member Author

Implemented with the -z or the --zeroconf-port

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

No branches or pull requests

3 participants