Giter Club home page Giter Club logo

switcher's Introduction

Switcher

Switcher

Switcher is a proxy server which accepts connections and proxies based on which protocol is detected.

Currently implemented is:

  • SSH

The use case is running HTTP(S) and SSH on the same port.

Usage

Download release or Build:

make

To get help:

$ ./switcher --help
Switcher 1.0.0
usage: switcher [options]

Options:
  --listen   <:80>            Server Listen Address
  --ssh      <127.0.0.1:22>   SSH Server Address
  --default  <127.0.0.1:8080>  Default Server Address

Examples:
  To serve SSH(127.0.0.1:22) and HTTP(127.0.0.1:8080) on port 80
  $ switcher

  To serve SSH(127.0.0.1:2222) and HTTPS(127.0.0.1:443) on port 443
  $ switcher --listen :443 --ssh 127.0.0.1:2222 --default 127.0.0.1:443

Example

Run switcher on HTTP port 80, proxy to SSH on 127.0.0.1:22 and Nginx on 127.0.0.1:8080

$ switcher --listen :80 --ssh 127.0.0.1:22 --default 127.0.0.1:8080

To test HTTP:

$ curl -I http://my-server.local
HTTP/1.1 200 OK

To test SSH

$ ssh [email protected] -p 80
Password:

Why not sslh

Switcher is heavily influenced by sslh. It started out as a learning exercise to discover how sslh worked and attempt an implementation in Go.

The result is useful in its own right through use of Go's interfaces for protocol matching (making adding new protocols trivial), and lightweight goroutines (instead of forking, which is more CPU intensive under load).

License

3-Clause "Modified" BSD Licence.

License

switcher's People

Watchers

 avatar  avatar

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.