Skip to content
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

Getting Hostname from Client-Connection #384

Open
Bizarrus opened this issue Jan 6, 2025 · 0 comments
Open

Getting Hostname from Client-Connection #384

Bizarrus opened this issue Jan 6, 2025 · 0 comments

Comments

@Bizarrus
Copy link

Bizarrus commented Jan 6, 2025

If the Server is listen to any address like ftp://0.0.0.0:21, how i can find the connection hostname/domain?

Users have their own subdomain like <user>.example.com and will use these for the FTP-Connection.
But the connection parameter on the login-Event has no informations about that.

The FtpConnection object has only following informations:

FtpConnection {
    server: FtpServer {
        options: {
          url: 'ftp://0.0.0.0:21',
          // [...]
        },
        url: Url {
          host: '0.0.0.0:21',
          port: '21',
          hostname: '0.0.0.0',
          href: 'ftp://0.0.0.0:21/',
          // [...]
        },
        server: Server {
          _connectionKey: '4:0.0.0.0:21',
          // [...]
        },
    },
    commandSocket: <ref *2> Socket {
        _sockname: { address: '89.22.***.***', family: 'IPv4', port: 21 }, // The Server-IP
        _peername: { address: '95.223.***.***', family: 'IPv4', port: 26743 }, // The Client-IP
        // [...]
    },
    log: Logger {
        src: false,
        fields: {
            hostname: 'example.com', // No subdomain!
            ip: '95.223.***.***', // The Client-IP
            // [...]
        },
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant