GithubHelp home page GithubHelp logo

bonjour-ftpd's Introduction

bonjour-ftpd

A simple SSL FTP server/client that uses DNS-SD for discovery

by @colindean

Introduction

I wrote this as a simple example meeting the requirements of a post on /r/ruby: A peer-to-peer file transfer system featuring peer discovery and secure file transfer.

This example sets up an FTPd with SSL enabled that announces its availability using DNS-SD and mDNS. The client then browses for servers that are announcing its expected service name, then connects and lists files.

Requirements

See Gemfile. I wrote this on Ruby 2.1.0 on OSX.

Running

First, install gems.

bundle install

In one terminal, run the server.

ruby server.rb

Grab the directory that's output when the server starts. You can put a file in there with something like

touch /var/whatever/this/is/this-is-a-file

In another terminal,

ruby client.rb

You should see some output like this:

Ruby\032FTPS\032DNSSD\032Example._ftps._tcp.local.
Listing files available on Ruby FTPS DNSSD Example on kid.local.:8721
-rw-r--r-- 1 colin    staff           0 Feb 16 14:03 this-is-a-file

The server will stay running. The client will, too, so you'll have to kill it to run it again.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.