Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
9k views
in Java FTP by (1.3k points)
Does edtFTPj/PRO let us interface at some command level, such as at the PASV/PORT command level.
I need to interface the PASV command level because I have to extract and process the information (IP/Port) sent back by the server to this command before letting the client opening the data channel.
Interfacing the PORT command level to have more control which IP/Port the client should use and send back to the server instead of letting it choose from a given IP/port range.

11 Answers

0 votes
by (161k points)
You can force the server's IP address to be used for the PASV command via setAutoPassiveSubstitution (rather than the one returned). You can't change the port number, but unless there's some kind of port mapping going on, you have to connect to the port the server is listening on.

For the PORT command, you have total control over the port numbers sent back - see setActivePortRange. You can also set the IP address that is sent.

If this isn't enough for what you need, let us know - we could add a callback to pass the info to a method you implement, where you could modify the IP address/port.
0 votes
by (1.3k points)
In our environment, the ftpclient should not do a direct connection to the server. Instead, it should connect to a host, which then relays the data to the server.
Relying to this fact, it would be great if we could have the port number, which is sent back by the ftp server on PASV reply, just before the data connection will be opened, so that we can prepare the relay host to do a port mapping.
0 votes
by (161k points)
we'll take a look at this and post back.
0 votes
by (1.3k points)
thanks, I hope I will get a good news soon.
0 votes
by (161k points)
send an email to support at enterprisedt dot com for a build that allows you to do this
0 votes
by (1.3k points)
I was sent a temporary jar, which enable me to interface at PASV/PORT level.
If I may make another request, is it possible to interface the PORT command so that we can do something just before/after the ServerSocket will be created?
I need this functionality to be able to make sure that the ServerSocket can be successfully created, before doing a mapping to the port chosen by the PORT.
0 votes
by (161k points)
We've added a callback that supply the ip address & port number about to be used for PASV & PORT, and allow you to modify these.

I don't really understand what you mean by the above post.

We're about to release 3.0.1 at your request so please clarify.
0 votes
by (51.4k points)
Could you please elaborate on what you mean?

The interface Bruce has provided is as follows:
public interface DataChannelCallback {
     public IPEndpoint onPASVResponse(IPEndpoint endpoint);
     public IPEndpoint onPORTCommand(IPEndpoint endpoint);
}

Perhaps you could suggest an additional function that could be added to the interface.

- Hans (EnterpriseDT)
0 votes
by (1.3k points)
public interface DataChannelCallback {
public IPEndpoint onPASVResponse(IPEndpoint endpoint);
public IPEndpoint onPORTCommand(IPEndpoint endpoint);
}

The onPORTCommand(IPEndpoint endpoint) will only deliver the IP and port it will use for the data channel.
At this point, I thought that the ServerSocket has not been created yet, which is not correct. I just wanted to make sure that the ServerSocket has been created before the client delivers us the IP/Port.
So everything is fine. These two methods work fine.
0 votes
by (161k points)
Yes, the socket is already created - this just permits you to modify the IP address and port number that is sent to the server.

Categories

...