Start implementing custom ssh server

Turns out SSH has robust semantics for opening generic channels.
Looks like I'll be able to set up tunnels without ever needing to
forward ports on the server, since I can connect the channels with
a custom protocol.

Of course I'll eventually want to support generic SSH clients, but
this makes starting much easier.
This commit is contained in:
Anders Pitman
2020-10-01 17:22:54 -06:00
parent 84b7c0828e
commit 59c824bfca
3 changed files with 123 additions and 27 deletions

View File

@@ -34,6 +34,7 @@ type BoringProxy struct {
tunMan *TunnelManager
adminListener *AdminListener
certConfig *certmagic.Config
sshServer *SshServer
}
func NewBoringProxy() *BoringProxy {
@@ -67,7 +68,9 @@ func NewBoringProxy() *BoringProxy {
auth := NewAuth()
p := &BoringProxy{config, auth, tunMan, adminListener, certConfig}
sshServer := NewSshServer()
p := &BoringProxy{config, auth, tunMan, adminListener, certConfig, sshServer}
http.HandleFunc("/", p.handleAdminRequest)
go http.Serve(adminListener, nil)