Socket
Socket
Sign inDemoInstall

ftp-proxy

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ftp-proxy

NodeJS ftp proxy prepared for active and passive connections with transfer stats plugin and logging module


Version published
Maintainers
1
Created
Source

NodeJS FTP Proxy

NodeJS ftp proxy prepared for active and passive connections with transfer stats plugin and logging module.

Stats plugin already has a solution for using rabbitMQ as stats' message publisher.

For more details, go to our Wiki page

$ npm install ftp-proxy

Usage example

(function(){
	var ftpd = require('ftp-proxy');
	var _config = require('./config');
	var _p = {
		'server': null,
		'init': function(){	
			_p.ftpProxy.set();
			return self;
		},
		'ftpProxy': {
		    'set': function () {
		        var proxy = new ftpd(_config);
				proxy.listen(_config.proxyData.port);
				proxy.on("error", _p.ftpProxy.onError);
			},
			'onError': function(error) {
				console.error(error);
			}
		}
	};
	var self = {};
	return	_p.init();
})();

config.js file example


module.exports = {
    serverData: { 
        host: '127.0.0.1', 
        port: 21 
    },
    proxyData: {
        id: 'Proxy test local machine',
        ip: '127.0.0.1',
        port: 2121,
        machineName: 'Test Machine'
    },
    logging: {
        useConsole: true,
        useFile: true,
        filePath: 'FTPProxy-Logging(%DATE%).log',
        level: 'DEBUG'
    },
    statsPlugin: {
    	usePlugin: true,
        activeStatusInterval: 10 * 1000, //10 seconds in milliseconds
        inactiveStatusInterval: 1 * 60 * 60 * 1000, //1 hour in milliseconds
        timeToIgnoreIdleTransfer: 10 * 60 * 1000  //10 minutes in milliseconds
    },
    messagePublisher: {
	    connectionString: 'your rabbit connection string',
	    exchange: {
	        name: 'FtpProxy.Notifications',
	        options: {
	            type: 'topic'
	        }
	    },
	    RK: {
	        snapshot: {
	            name : 'FtpProxy.Notifications.Snapshot',
	            options:{
	                type: 'FtpProxy.FtpStatus'
	                ,contentType: 'application/json'
	                ,contentEncoding: 'utf-8'
	                ,immediate: true
	            }
	        },
	        onTransferStarted: {
	            name : 'FtpProxy.Notifications.OnTransferStarted',
	            options:{
	                type: 'FtpProxy.FtpTransferInfo'
	                ,contentType: 'application/json'
	                ,contentEncoding: 'utf-8'
	                ,immediate: true
	            }
	        },
	        onTransferEnded: {
	            name : 'FtpProxy.Notifications.OnTransferEnded',
	            options:{
	                type: 'FtpProxy.FtpTransferInfo'
	                ,contentType: 'application/json'
	                ,contentEncoding: 'utf-8'
	                ,immediate: true
	            }
	        },
	        onTransferAborted: {
	            name : 'FtpProxy.Notifications.OnTransferAborted',
	            options:{
	                type: 'FtpProxy.FtpTransferInfo'
	                ,contentType: 'application/json'
	                ,contentEncoding: 'utf-8'
	                ,immediate: true
	            }
	        }
	    }
	}
}

Keywords

FAQs

Package last updated on 08 Jul 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc