This project is a file transfer server based on the I2TCP communication protocol. The effective key length reaches 512 bits. It also has a dual-factor authentication mechanism like Google to ensure that the service can survive safely in a public network environment.
pip install i2ftp-server
Python3.6+i2cylib >= 1.8.14i2ftps-setup Server Configuration Wizardi2ftps server start/stop /usr/share/i2ftp/server_conf.json
b"I2FTP xx" Underlying TCP/IP ← I2TCP ← User Top Level
Client command - "Query": LIST,<PATH>
<bool 路径是否存在>,{'文件1':{is_dir:<bool 是否是文件夹> size:<int 大小>, time:<float 文件修改时间戳>}} Client Command - "Request Download": GETF,<PATH>
<bool 请求是否接受>,[16 bytes 下载会话ID] Client command - "Download via Session ID": DOWN,<16 bytes 下载会话ID>,<uint64 文件指针偏移量>,<uint64 截止文件指针偏移量>
If a single return packet cannot transmit the requested length at once, the server will send multiple packets in turn until the requested length is satisfied.
If截止文件指针偏移量≤文件指针偏移量, the server will consider that data from文件指针偏移量to the end of the file is requested.
Return: <bool 操作是否有效>,[uint64 文件指针偏移量],[bytes 数据内容最大长度524128 Bytes] (single or sequence)
Client command - "Request Upload": PULF,<PATH>,<str_hex 文件哈希校验值>
<bool 操作是否有效>,[16 bytes 上传会话ID] Client command - "Upload via session ID": UPLD,<16 bytes 上传会话ID>,<uint64 文件指针偏移量>,<bytes 数据内容最大长度524128 Bytes>
<bool 上传是否成功>,[int 当前文件指针偏移量] Client Command - "Close Session": CLOZ,<16 bytes 会话ID>
<bool 操作是否成功>,[hex_str 若会话为下载会话,则会同时返回文件的MD5校验值] Client command - "File/Folder Operation": FIOP,<int 命令:0-重命名,1-移动,2-复制,3-删除,4-创建目录>,<str 路径1>,[str 路径2]
<bool 操作是否成功> Administrator command - "Process Control": PCTL,[raw 保留字段]
<bool 操作是否成功>,<int 进程PID>