Skip to content

Commit 0b8f756

Browse files
committed
Improve naming
1 parent 67a53f2 commit 0b8f756

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ client.ftp.verbose = true
6969

7070
Create a client instance. Configure it with a timeout in milliseconds that will be used for any connection made. Use 0 to disable timeouts, default is 30 seconds. Options are:
7171

72-
- `ignoreTransferHostIP (boolean)`, use this to use the control host IP also for transfers. This can fix local NAT issues and provide better security to prevent bounce attacks. Default is *false* for backwards-compatibility reasons where FTP does allow different IPs for control and transfer hosts. Note that for modern servers, this client will use EPSV instead of PASV to request a transfer connection which uses the control host IP by default anyway.
72+
- `allowSeparateTransferHostIP (boolean)`, the FTP spec makes it possible for a server to tell the client to use a different IP address for file transfers than for the initial control connection. Today, this feature is very rarely used. Still, the default for this is set to `true` for backwards-compatibility reasons. If you experience any issues with NAT traversal in local networks or want to provide more security and prevent FTP bounce attacks, set this to `false`.
7373

7474
`close()`
7575

src/Client.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,11 @@ export interface UploadOptions {
5050
}
5151

5252
export interface ClientOptions {
53-
ignoreTransferHostIP: boolean
53+
allowSeparateTransferHostIP: boolean
5454
}
5555

5656
const defaultClientOptions: ClientOptions = {
57-
ignoreTransferHostIP: false
57+
allowSeparateTransferHostIP: true
5858
}
5959
const LIST_COMMANDS_DEFAULT = () => ["LIST -a", "LIST"]
6060
const LIST_COMMANDS_MLSD = () => ["MLSD", "LIST -a", "LIST"]
@@ -80,7 +80,7 @@ export class Client {
8080
this.ftp = new FTPContext(timeout)
8181
this.prepareTransfer = this._enterFirstCompatibleMode([
8282
enterPassiveModeIPv6,
83-
options.ignoreTransferHostIP ? enterPassiveModeIPv4_forceControlHostIP : enterPassiveModeIPv4
83+
options.allowSeparateTransferHostIP ? enterPassiveModeIPv4 : enterPassiveModeIPv4_forceControlHostIP
8484
])
8585
this.parseList = parseListAutoDetect
8686
this._progressTracker = new ProgressTracker()

0 commit comments

Comments
 (0)