Run SSH and HTTP(S) on the same port
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
extra Initial Commit Jan 20, 2015
.gitignore Added Releases Jan 20, 2015
LICENSE Initial Commit Jan 20, 2015
Makefile Added Releases Jan 20, 2015 Added Retina Logo Jan 21, 2015
main.go Bumped Verson to 1.0.1 Jan 22, 2015
mux.go Initial Commit Jan 20, 2015
shovel.go fix goroutine leak Jan 21, 2015
ssh.go Initial Commit Jan 20, 2015
tcp.go Initial Commit Jan 20, 2015



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.


Download release or Build:


To get help:

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

  --listen   <:80>            Server Listen Address
  --ssh      <>   SSH Server Address
  --default  <>  Default Server Address

  To serve SSH( and HTTP( on port 80
  $ switcher

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


Run switcher on HTTP port 80, proxy to SSH on and Nginx on

$ switcher --listen :80 --ssh --default

To test HTTP:

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

To test SSH

$ ssh james@my-server.local -p 80

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).


3-Clause "Modified" BSD Licence.