{"id":13499430,"url":"https://github.com/jamescun/switcher","last_synced_at":"2025-03-29T04:31:18.856Z","repository":{"id":26109187,"uuid":"29553477","full_name":"jamescun/switcher","owner":"jamescun","description":"Run SSH and HTTP(S) on the same port","archived":false,"fork":false,"pushed_at":"2019-03-15T13:19:58.000Z","size":191,"stargazers_count":906,"open_issues_count":5,"forks_count":73,"subscribers_count":34,"default_branch":"master","last_synced_at":"2024-11-12T09:31:49.802Z","etag":null,"topics":["golang","http","https","proxy","ssh","sslh"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jamescun.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-01-20T21:37:36.000Z","updated_at":"2024-11-09T08:16:56.000Z","dependencies_parsed_at":"2022-07-27T06:16:18.926Z","dependency_job_id":null,"html_url":"https://github.com/jamescun/switcher","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamescun%2Fswitcher","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamescun%2Fswitcher/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamescun%2Fswitcher/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamescun%2Fswitcher/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jamescun","download_url":"https://codeload.github.com/jamescun/switcher/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246140565,"owners_count":20729797,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["golang","http","https","proxy","ssh","sslh"],"created_at":"2024-07-31T22:00:33.095Z","updated_at":"2025-03-29T04:31:18.525Z","avatar_url":"https://github.com/jamescun.png","language":"Go","readme":"\u003cimg src=\"https://i.imgur.com/Fo1W2rL.png\" width=\"269\" height=\"62\" alt=\"Switcher\"/\u003e\n\nSwitcher\n========\n\nSwitcher is a proxy server which accepts connections and proxies based on which protocol is detected.\n\nCurrently implemented is:\n\n  - SSH\n\nThe use case is running HTTP(S) and SSH on the same port.\n\n\nUsage\n-----\n\n[Download release](https://github.com/jamescun/switcher/releases) or Build:\n\n    make\n\nTo get help:\n\n    $ ./switcher --help\n    Switcher 1.0.0\n    usage: switcher [options]\n\n    Options:\n      --listen   \u003c:80\u003e            Server Listen Address\n      --ssh      \u003c127.0.0.1:22\u003e   SSH Server Address\n      --default  \u003c127.0.0.1:8080\u003e  Default Server Address\n\n    Examples:\n      To serve SSH(127.0.0.1:22) and HTTP(127.0.0.1:8080) on port 80\n      $ switcher\n\n      To serve SSH(127.0.0.1:2222) and HTTPS(127.0.0.1:443) on port 443\n      $ switcher --listen :443 --ssh 127.0.0.1:2222 --default 127.0.0.1:443\n\n\nExample\n-------\n\nRun switcher on HTTP port 80, proxy to SSH on 127.0.0.1:22 and Nginx on 127.0.0.1:8080\n\n    $ switcher --listen :80 --ssh 127.0.0.1:22 --default 127.0.0.1:8080\n\nTo test HTTP:\n\n    $ curl -I http://my-server.local\n    HTTP/1.1 200 OK\n\nTo test SSH\n\n    $ ssh james@my-server.local -p 80\n    Password:\n\n\nWhy not sslh\n------------\n\nSwitcher is heavily influenced by [sslh](https://github.com/yrutschle/sslh). It started out as a learning exercise to discover how sslh worked and attempt an implementation in Go.\n\nThe 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).\n\n\nLicense\n-------\n\n3-Clause \"Modified\" BSD Licence.\n\n[License](LICENSE)\n","funding_links":[],"categories":["Apps","Go","HarmonyOS","Tools"],"sub_categories":["Network","Windows Manager","Go"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamescun%2Fswitcher","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjamescun%2Fswitcher","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamescun%2Fswitcher/lists"}