Skip to content
This repository has been archived by the owner on Apr 21, 2019. It is now read-only.


Folders and files

Last commit message
Last commit date

Latest commit



39 Commits

Repository files navigation

LFTP server Build Status Go Report Card license

JSON RPC server for LFTP.


LFTP server is a HTTP server that accepts FTP download requests in JSON format and forwards them to LFTP. Requests have the following format:

	"path": "...",
	"username": "...",
	"password": "...",
	"secret": "..."

Path is FTP file or directory to be downloaded, username/password are optional FTP credentials, and secret must match --rpc-secret parameter used when server was started.

If the request was valid, server sends 200 OK response to the client, with the ID of the created job. Response looks like this:

	"id": "..."

In case of any error, server sends 400 Bad Request to the client, with the error message in the following format:

	"message": "..."

If FTP credentials are missing or invalid, server responds to the client with 401 Unauthorized status code.


$ go get

Binaries (x64)

Mac OS X


$ ./lftp-server
Usage of ./lftp-server:
  -max-retries int
	  The maximum number of sequential tries of an operation without success. Possible values: 1-100 (default 5)
  -n int
	  Number of connections to use when downloading single file. Possible values: 1-100 (default 4)
  -o string
	  Output directory (optional, default value is the current working directory)
  -p int
	  Number of files to download in parallel when mirroring directories. Possible values: 1-10 (default 1)
  -rpc-listen-port int
	  Specify a port number for JSON-RPC server to listen to. Possible values: 1024-65535 (default 7800)
  -rpc-secret string
	  Set RPC secret authorization token (required)
  -s string
	  Script to run after successful download


$ ./lftp-server -rpc-listen-port 7800 -rpc-secret SECRET -max-retries 10 -n 4 -p 1 -o ~/Downloads -s ./