Multiplex http and ssh ports
This commit is contained in:
parent
668f1dd193
commit
f0073a649f
20 changed files with 188 additions and 29 deletions
|
|
@ -23,6 +23,14 @@ type HTTPConfig struct {
|
|||
CertbotEmail string `yaml:"certbot_email" validate:"email"`
|
||||
}
|
||||
|
||||
// TCPMuxCommand generates a command line for the sslh executable.
|
||||
func (hcfg HTTPConfig) TCPMuxCommand(addr string, http string, https string, ssh string) string {
|
||||
if hcfg.HTTPSEnabled() {
|
||||
return fmt.Sprintf("-bind %s -http %s -tls %s -rest %s", addr, http, https, ssh)
|
||||
}
|
||||
return fmt.Sprintf("-bind %s -http %s -rest %s", addr, http, ssh)
|
||||
}
|
||||
|
||||
// HTTPSEnabled returns if the distillery has HTTPS enabled, and false otherwise.
|
||||
func (hcfg HTTPConfig) HTTPSEnabled() bool {
|
||||
return hcfg.CertbotEmail != ""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue