Skip to content

Getting Hostname from Client-Connection #384

Description

@Bizarrus

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
            // [...]
        },
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions