identd
v1.0.2
Published
This is a client based ident protocol library, where you can request an identity to an ident server.
Downloads
16
Readme
Introduction
Ident Protocol is an Internet protocol that helps identify the user of a particular TCP connection.
One popular daemon program for providing the ident service is identd.
This is a client based ident protocol library, where you can request an identity to an ident server.
Request Options
address--> the identd server ip addressport--> identd server port, if is undefined 113 is used by defualtserver_port--> local port from the identd server machineclient_port--> remote port where the identd server machine is connected toabort--> feel free to abort a connection if they receive 1000 characters without receiving an , by default is true.
Response Structure
server_port--> same as the request optionsclient_port--> same as the request optionsstatus--> status of the responseopsys--> opsys type, if opsys is defined, then is an ident replyuserid--> userid string or Buffer, if userid is defined, then is an ident replyerror--> error type, if error type is defined, then is an error replycharset--> custom charset, if charset is defined then userid is type of buffer. If is not then userid is an string with US-ASCII charset.
Error Types
UNDEFINED_SERVER_PORT--> undefined server protUNDEFINED_LOCAL_PORT--> undefined local portINVALID_RESPONSE_LENGTH--> invalid response lengthINVALID_STATUS_RESPONSE--> invalid status responseINVALID_OPSYS_RESPONSE--> invalid opsys responseINVALID_CHARSET_RESPONSE--> invalid charset responseINVALID_USERID_LENGTH--> invalid userid lengthINVALID_ERROR_TOKEN--> invalid error token length
Example
import Identd, { Response } from "identd";
Identd.request({
address: '172.26.41.85',
server_port: 39904,
client_port: 4444
})
.then((response : Response) => console.log(response))
.catch(err => console.log("Some error: " + err));References
- https://www.rfc-editor.org/rfc/rfc1413 (ident proto)
- https://www.rfc-editor.org/rfc/rfc1340 (for charset)
