mooware/mooftpserv

Question: Is it possible to limit the data port range?

Closed this issue · 1 comments

Hi,

Is it possible to limit the data port range?

Example : 1024 - 2048

Thanks in advance!

Currently I'm letting the operating system choose the port, and it will most likely use the IANA range for dynamic ports at 49152–65535 (https://en.wikipedia.org/wiki/Ephemeral_port). It would be possible to implement it so that it assigns ports from your suggested range, but it's not advisable in general, since it might be a range where people will put their server ports.

If you want to modify the assigned ports, you can change it here:

dataSocket.Bind(new IPEndPoint(serverIP, 0));