0.2.1 • Published 5 years ago

rfc959_stream v0.2.1

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

RFC 959 stream

Pure Streaming FTP. Command and control funnel inherits from Stream Readable. Socket responses parsed and routed in Stream Transform.

Readable -> Duplex (Net) -> Analyze/Transform --->|
    ^                                             |
    |                                             |
    |<--------------------------------------------v  (More Pipeline)

Funnel -> Network Stream Socket -> pipe cap

Install

	yarn install --flat

Requirements

This requires colorlogjs, which is still pending distribution channel.

Usage during Development

export ENV_NAME=dev; node --inspect js-ftp --intelligence ../../some/folder/ai_brain.js  --config ../../../another/folder/config.js

Usage Production

export ENV_NAME=prod; node  . --intelligence ftp_ai_brain.js
Incompleteness

The streaming framework allows any command to be sent and received. It only handles special case insofar as actions for listing directory contents and downloading files by enabling PASV data connection via a secondary network socket.

The framework itself is generically useful enough to allow the programmer and supporting scripts to directly manage return codes using the streaming interfaces of the network duplex socket.

TODO, of Interest

In semi important order.

  • Implement FTPS: RFC 2246, RFC 2228, RFC 4217
  • Implement all extensions: RFC 2228, RFC 5797, RFC 7151, RFC 2389, RFC 1123, RFC 1545, RFC 1639

FTPS -> FTP over TLS. Distinct from SFTP. Previously FTPS included SSL, but SSL is considered insecure / inferior than other cryptographic protocols. In this library TLS, FTP (RFC 959) + TLS

Reference for TLS over HTTP https://tools.ietf.org/html/rfc2817

  • FXP transfers
  • Anonymous user
  • Active data connection

####### References, Resources

  1. https://www.rfc-editor.org/rfc/rfc959.txt
  2. https://en.wikipedia.org/wiki/FTPS
  3. https://tools.ietf.org/html/rfc2228
  4. https://tools.ietf.org/html/rfc4217
  5. https://tools.ietf.org/html/rfc2246
  6. https://tools.ietf.org/html/rfc2817
  7. https://tools.ietf.org/html/rfc2389
  8. https://tools.ietf.org/html/rfc5797
  9. https://tools.ietf.org/html/rfc7151
  10. https://tools.ietf.org/html/rfc1639
  11. https://tools.ietf.org/html/rfc1545
  12. https://tools.ietf.org/html/rfc1123
  13. https://tools.ietf.org/html/rfc2389

Errors

  • FTP CODE 530 - unless the ai brain has logic to handle this causes a dead connection.