{"id":15136960,"url":"https://github.com/deniskovalchuk/libftp","last_synced_at":"2025-10-28T01:05:05.454Z","repository":{"id":55837259,"uuid":"155916414","full_name":"deniskovalchuk/libftp","owner":"deniskovalchuk","description":"A cross-platform FTP/FTPS client library built on Boost.Asio","archived":false,"fork":false,"pushed_at":"2024-12-31T16:44:55.000Z","size":1037,"stargazers_count":69,"open_issues_count":1,"forks_count":12,"subscribers_count":5,"default_branch":"develop","last_synced_at":"2025-04-02T06:49:12.413Z","etag":null,"topics":["boost-asio","cpp17","cross-platform","ftp","ftp-client","ftp-library","ftps","networking","openssl","rfc-959"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/deniskovalchuk.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-11-02T20:09:47.000Z","updated_at":"2025-03-23T05:15:45.000Z","dependencies_parsed_at":"2023-02-01T01:20:42.459Z","dependency_job_id":"9af96915-a969-48d6-90bf-4d933f7dd9b5","html_url":"https://github.com/deniskovalchuk/libftp","commit_stats":{"total_commits":255,"total_committers":3,"mean_commits":85.0,"dds":0.0117647058823529,"last_synced_commit":"6567febd932b897a3393d406e88d3cfc44aeee08"},"previous_names":["deniskovalchuk/ftp-client"],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deniskovalchuk%2Flibftp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deniskovalchuk%2Flibftp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deniskovalchuk%2Flibftp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deniskovalchuk%2Flibftp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/deniskovalchuk","download_url":"https://codeload.github.com/deniskovalchuk/libftp/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248036063,"owners_count":21037092,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["boost-asio","cpp17","cross-platform","ftp","ftp-client","ftp-library","ftps","networking","openssl","rfc-959"],"created_at":"2024-09-26T06:42:10.173Z","updated_at":"2025-10-28T01:05:05.449Z","avatar_url":"https://github.com/deniskovalchuk.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# libftp\n\n[![C++](https://img.shields.io/badge/C++-17-blue)](https://en.cppreference.com/w/cpp/17)\n[![License](https://img.shields.io/badge/License-MIT-blue)](LICENSE)\n\n[![Actions Workflow Windows](https://github.com/deniskovalchuk/ftp-client/actions/workflows/windows.yml/badge.svg)](https://github.com/deniskovalchuk/ftp-client/actions/workflows/windows.yml)\n[![Actions Workflow Linux](https://github.com/deniskovalchuk/ftp-client/actions/workflows/linux.yml/badge.svg)](https://github.com/deniskovalchuk/ftp-client/actions/workflows/linux.yml)\n[![Actions Workflow macOS](https://github.com/deniskovalchuk/ftp-client/actions/workflows/macos.yml/badge.svg)](https://github.com/deniskovalchuk/ftp-client/actions/workflows/macos.yml)\n\n[![Conan](https://img.shields.io/conan/v/libftp?label=Conan\u0026color=blue)](https://conan.io/center/recipes/libftp)\n[![Vcpkg](https://img.shields.io/vcpkg/v/deniskovalchuk-libftp?color=9370DB)](https://vcpkg.io/en/package/deniskovalchuk-libftp)\n\nA cross-platform FTP/FTPS client library built on [Boost.Asio](https://www.boost.org/doc/libs/1_87_0/doc/html/boost_asio.html).\n\n## Table of contents\n\n1. [Overview](#overview)\n1. [Features](#features)\n1. [Examples](#examples)\n1. [Integration](#integration)\n1. [Building](#building)\n1. [References](#references)\n\n## Overview\n\nThis library provides client-side functionality for the File Transfer Protocol (FTP), offering\na flexible solution for transferring files between a client and a server.\n\n### Connections\n\nFTP employs two separate connections:\n\n- **Control connection:** A persistent connection used to exchange commands and replies between the client and the server.\n- **Data connection:** A temporary connection established solely for transferring files. It remains open only for the duration of the transfer.\n\n### Transfer modes\n\nThe transfer mode determines how the data connection is established.\n\n#### Active mode\n\n- The client uses the control connection to send the server its own IP address and a port number where\nit will accept an incoming data connection.\n- The server then uses this information to initiate and open the data connection to the client.\n\n#### Passive mode\n\n- The client uses the control connection to request the server's IP address and a port number where\nthe server will accept an incoming data connection.\n- The client then uses this information to initiate and open the data connection to the server.\n\nThis mode is useful in scenarios where the client is unable to accept incoming connections,\nsuch as when operating behind a firewall or NAT.\n\n### Transfer types\n\nThe transfer type determines how data is transferred. \n\n#### ASCII type\n\n- The sender converts newline characters from system style to `CRLF` style, and the receiver performs the\nreverse conversion.\n- Suitable for transferring text files between systems with different newline conventions.\n\n#### Binary type\n\n- Transfers files byte by byte without modifications.\n- Ideal for binary files, including images, videos, and archives.\n\n## Features\n\n- Windows, Linux and macOS are supported.\n- Supports FTP and FTP over TLS/SSL (FTPS).\n- Supports IPv4 and IPv6.\n- Supports active and passive transfer modes.\n- Supports ASCII and binary transfer types.\n\n## Examples\n\nDownload the `README.TXT` file from [ftp.freebsd.org](https://download.freebsd.org/) and output its contents to `stdout`:\n\n```c++\n#include \u003ciostream\u003e\n#include \u003csstream\u003e\n\n#include \u003cftp/ftp.hpp\u003e\n\nint main(int argc, char *argv[])\n{\n    ftp::client client;\n\n    client.connect(\"ftp.freebsd.org\", 21, \"anonymous\");\n\n    std::ostringstream oss;\n\n    client.download_file(ftp::ostream_adapter(oss), \"pub/FreeBSD/README.TXT\");\n\n    std::cout \u003c\u003c oss.str();\n\n    client.disconnect();\n\n    return 0;\n}\n```\n\nSee more examples in the [example](example) folder.\n\n## Integration\n\nThis library can be integrated into a project via CMake's `FetchContent`, for example:\n\n```cmake\ncmake_minimum_required(VERSION 3.14)\nproject(application)\n\ninclude(FetchContent)\nFetchContent_Declare(\n        libftp\n        GIT_REPOSITORY https://github.com/deniskovalchuk/libftp.git\n        GIT_TAG        v1.5.0)\nFetchContent_MakeAvailable(libftp)\n\nadd_executable(application main.cpp)\ntarget_link_libraries(application ftp::ftp)\n```\n\n## Building\n\n### Prerequisites\n\n- A C++17-compliant compiler\n- CMake 3.14 or newer\n- Boost 1.88 or newer\n- OpenSSL\n- Python3, pyOpenSSL (only for tests)\n\n### Windows\n\nBuild and run tests:\n\n```\ntool/windows/build.ps1 [-BuildType Debug|Release] [-RunTest]\n```\n\nClean the builds:\n\n```\ntool/windows/clean.ps1\n```\n\n### Linux/macOS\n\nBuild and run tests:\n\n```\ntool/unix/build.sh [--debug | --release] [--test]\n```\n\nClean the builds:\n\n```\ntool/unix/clean.sh\n```\n\n### Custom environment\n\nBuild:\n\n```bash\n$ mkdir -p build\n$ cd build\n$ cmake ..\n$ cmake --build .\n```\n\nTo run tests, set the `LIBFTP_TEST_SERVER_PATH` environment variable to the path to the\n[server.py](test/server/server.py) file:\n\n```bash\n$ export LIBFTP_TEST_SERVER_PATH=\"/path/to/server.py\"\n$ cd test\n$ ctest -V\n```\n\n## References\n\n- [RFC 959](doc/RFC959.txt) File Transfer Protocol (FTP). J. Postel, J. Reynolds. October 1985.\n- [RFC 2228](doc/RFC2228.txt) FTP Security Extensions. October 1997.\n- [RFC 2428](doc/RFC2428.txt) Extensions for IPv6, NAT, and Extended passive mode. September 1998.\n- [RFC 3659](doc/RFC3659.txt) Extensions to FTP. P. Hethmon. March 2007.\n- [RFC 4217](doc/RFC4217.txt) Securing FTP with TLS. October 2005.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeniskovalchuk%2Flibftp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeniskovalchuk%2Flibftp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeniskovalchuk%2Flibftp/lists"}