-
Notifications
You must be signed in to change notification settings - Fork 119
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
Allow specifying incoming torrent port #27
Conversation
I feel a bit reluctant, as I'm not sure many people need this (and the One thing I'd definitely change is using the default torrent port (6882), as for many users this port is probably blocked (or monitored?). |
I agree on randomizing by default / if left empty. Probably in the range of 1025-10000 to avoid <=1024 root related issues. Otherwise, to me it makes sense. You're most likely uploading anyway, so why not help other peers which are NATed or otherwise firewalled? In my experience download speeds increase too. Not sure what to do about |
An idiomatic go practice is to replace a long list of arguments with a config structure. Something like type ClientConfig struct {
torrentPath string
port int
torrentPort int
seed bool
tcp bool
} A method on the structure could fill in the default values. |
Turns out port randomization has its drawbacks: http://dev.deluge-torrent.org/ticket/2133 How about keeping the current default by anacrolix/torrent and allowing to override it? Alternatively, one could generate a random port based on something that is host/machine specific and doesn't change. |
Ok, I've added The flags are bound to the config which is then passed to the client after flag parsing. |
Looks pretty good now! One thing I'd change is to make the fields of the
I understand that you just copied what I wrote, so it's clearly on me =) |
Ok :) I've amended the last commit and made the fields public. |
Looks great, thank you! |
Adds a new flag
-torrent-port
to specify the listening port for torrent connections.However having both
port
andtorrent-port
might be confusing. How abouthttp-port
andtorrent-port
orhttp
andtorrent
?As of now: