Coder Social home page Coder Social logo

silvio's Introduction

silvio

Build Status

Silvio is a VPN-over-WebSocket implementation, based on the TUN interface. I am using it to connect all my devices to a single virtual network through a web service. According to Wikpiedia, Silvio (Pellico) was an Italian writer, poet, dramatist and patriot active in the Italian unification. I spent some time of my life on a street that was named after him.

Installation

The code is written in Crystal and uses PostgreSQL to store the information about the networks and clients You can build the server and the client using following command:

shards build

Usage

Server

The server requires an empty PostgreSQL database it can be started with the following command:

bin/silvio-server -d postgres://user:pass@host:port/db

The server by default listens on 0.0.0.0:8090, you can get more information about how to tweak this if you pass the --help argument. Defining clients and networks is possible through the REST API:

# POST /networks
{
  "name": "test-net",
  "address": "192.168.10.0",
  "netmask": "255.255.255.0"
}

# POST /networks/1/clients
{
  "name": "test-client",
  "address": "192.168.10.1"
}

Client

The client uses TUN as the virtual network interface so it needs to run as a privileged user. There are two required arguments, the URL pointing to the server and a unique token stored in the database:

bin/silvio-client ws://<host>:<port> <token>

Development

After cloning the repository, you can install the dependencies by running shards and bundle. There are no unit tests, if they become available you will be able to run them using crystal spec. There is a high-level test in spec/ping/test-server.sh that requires docker and tests if two clients can ping each other.

Contributing

  1. Fork it (https://github.com/skateman/silvio/fork)
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Here are some ideas for contributions:

  • Storing IP addresses as numbers instead of strings
  • Optional traffic routing to the Internet (SOCKS-like)
  • Support for IPv6
  • Authentication for the REST API
  • Static frontend for the REST API
  • Load-balancing between multiple instances
  • Tests, tests and tests
  • OpenShift template
  • Support for Windows and OSX

License

This project is released under the MIT license.

silvio's People

Contributors

skateman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

mandymak

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.