This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 255982 - Active FTP external ip assign
Summary: Active FTP external ip assign
Status: VERIFIED FIXED
Alias: None
Product: php
Classification: Unclassified
Component: FTP Support (show other bugs)
Version: 8.2
Hardware: All All
: P2 normal (vote)
Assignee: Tomas Mysik
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-10-17 11:44 UTC by Elektrik
Modified: 2017-01-30 06:05 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Elektrik 2015-10-17 11:44:24 UTC
Hello,

I would like to suggest a feature to allow configure external address of active FTP. I have issues receiving errors like:

500 I won't open a connection to 192.168.1.xxx (only to 78.56.xx.xxx)

It is because I am behin a router and Netbeans passes wrong IP (my local one instead of external), so I really cannot use Active FTP.

Other software (like Filezilla for example) has a great configuration over this including limiting port ranges, entering external IP over active ftp and etc., so I think introducing it into Netbeans would allow to use Active ftp in all cases with external IP input there.

Thanks!
Comment 1 Tomas Mysik 2015-10-19 05:33:07 UTC
For FTP, NetBeans uses Apache Commons Net [1] - feel free to have a look whether such configuration option is available. If yes, it could be done quite easily.

Thanks.
[1] https://commons.apache.org/proper/commons-net/
Comment 2 Elektrik 2015-10-19 16:19:57 UTC
Thank you for reply, as documentation states (https://commons.apache.org/proper/commons-net/apidocs/org/apache/commons/net/ftp/FTPClient.html) it do have such feature:

void 	setActiveExternalIPAddress(String ipAddress)
Set the external IP address in active mode.

So just a simple textbox field for entering IP address there would be just fine, and during active connection check for

if(active_mode_external_ip != NULL){
setActiveExternalIPAddress(configuration.external_ip_addr);
}
Comment 3 Elektrik 2015-10-19 16:20:57 UTC
Also there is function:
void 	setActivePortRange(int minPort, int maxPort)
Set the client side port range in active mode.

So setting of port ranges are also available, which would be just great!
Comment 4 Tomas Mysik 2015-10-20 06:47:03 UTC
In such a case, it could be done. Thanks for investigating it!
Comment 5 Elektrik 2015-11-25 22:06:30 UTC
Any news when this may become available?

Thanks.
Comment 6 Tomas Mysik 2015-11-26 06:34:55 UTC
No idea now, busy working on other areas, sorry. Will try to look at it soon.

Thanks.
Comment 7 Tomas Mysik 2016-01-11 14:34:48 UTC
Hopefully there will be a place for these new fields...
Comment 8 Tomas Mysik 2016-01-12 13:52:08 UTC
Should be done now, please verify.

Thanks.

http://hg.netbeans.org/web-main/rev/cd87a1216d89
Comment 9 Elektrik 2016-01-12 14:33:49 UTC
I have downloaded Build 201601120002 (nightly), but I see it is not there yet, so cannot test.
Comment 10 Tomas Mysik 2016-01-12 14:58:19 UTC
Please, wait for a message that will appear here automatically. It will tell you in which daily build this change will be available.

Thanks.
Comment 11 Quality Engineering 2016-01-13 02:23:04 UTC
Integrated into 'main-silver', will be available in build *201601130002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/cd87a1216d89
User: Tomas Mysik <tmysik@netbeans.org>
Log: #255982 - Active FTP external ip assign
Comment 12 Elektrik 2016-01-13 12:04:59 UTC
Hey,

Just tested - now that's we are talking!!! Using active ftp project syncs, downloads and upload from ftp are hundreds of times faster than in passive mode.

However didn't checked the fields validations, but they should be fine, they are just an integer and IP fields. 

It also can be updated that if no ports are defined, they are automatically selected (not executing ports command, only IP assing), but that's fine.

What is great, that I can enter different ports for different projects - that's actually a feature over other software, which use same ports for all connections, quite a novel!

Thanks a lot, waiting this to be in live version!
Comment 13 Tomas Mysik 2016-01-13 12:10:02 UTC
Thanks for your feedback, marking as verified.
Comment 14 Elektrik 2017-01-29 00:32:49 UTC
Hello. I found an issue with active FTP (ports section).

In project I define active ports range 49500 - 65400. Same goes on my NAT forward on router (49500 - 65400). I do occasionally see an errors like "425 Unable to build data connection: Connection refused".

After I started to analyze what's wrong I found an issue - FTP client on netbeans tries to execute this command:
PORT 192,168,1,xxx,192,206 <- My internal IP, and last two comma imploded values are port, which is described as (192 DEC -> C0 HEX and 206 DEC -> CE, combining them as C0CE HEX -> 49358 DEC). So it tries to connect to port 49358 where I have ranges 49500..65400.

I am not sure if it's an apache ftp client bug, or command called in wrong time (before connection established) or with empty/wrong parameters. From source code it looks like everything is fine, but I think it should be good thing to debug "ftpClient.setActivePortRange(activePortMin, activePortMax);" section to check what values are applied and if it even being executed at all.

After a lot of tries in eventually fits into 49500..65400 range (because port count increased every connection) and works fine. After increase overcomes 65400 range it goes to 65535 port causing issues again.
Comment 15 Tomas Mysik 2017-01-30 06:05:17 UTC
Please, do not reopen verified issues. Report a new one. Thanks.