justinpage / simple-ftp-server

A concurrent File Transfer Protocol (FTP) server

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Simple FTP server

A concurrent File Transfer Protocol (FTP) server

Remote system type is UNIX.
Using binary mode to transfer files.
ftp> ls
227 Entering Passive Mode (127,0,0,1,215,236)
150 Accepted data connection
-rw-r--r--    1 justinpage  staff            10 May  20 13:28 message.md
drwxr-xr-x    3 justinpage  staff            96 May  20 13:28 server

About

The Go Programming Language textbook offers a study of concurrency using CSP. One of the exercises, created as a challenge for the reader, is to implement a concurrent File Transfer Protocol (FTP) server. That is, a server that allows concurrent connections from multiple clients.

While not a complete implementation of RFC 959, this exercise provides a survey of commands commonly used when interacting with an FTP server. This includes cd to change a directory, ls to list a directory, get to send the contents of a file, put to store the contents of a file, and many more.

As is in the name, simple-ftp-server, I wanted to create a simple FTP server that could be digested by someone new to the language or looking to build their own FTP server. Much of the logic implemented is sequential and doesn't shy away from duplication as design.

Compile

You will need the latest stable version of go installed on your machine:

https://golang.org/dl/

Run the following commands to download and build for execution:

  1. git clone https://github.com/justinpage/simple-ftp-server.git
  2. cd simple-ftp-server
  3. go build -o server main.go

Execute

  1. Launch ftp server: ./server
  2. Connect: ftp -P 8080 localhost
  3. Stop ftp server: Control+C to interrupt the process with SIGINT

References

About

A concurrent File Transfer Protocol (FTP) server


Languages

Language:Go 100.0%