Skip to content

Commit

Permalink
Add Setter functions for SSH.sshconfig and SSH.listener
Browse files Browse the repository at this point in the history
Closes #35
  • Loading branch information
qbit committed Mar 1, 2023
1 parent 7a361c7 commit 90ab74a
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions ssh.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,9 @@ func (s *SSH) createServerKey() error {
}

func (s *SSH) setup() error {
if s.sshconfig != nil {
return nil
}
config := &ssh.ServerConfig{
ServerVersion: fmt.Sprintf("SSH-2.0-gitkit %s", Version),
}
Expand Down Expand Up @@ -375,3 +378,13 @@ func (s *SSH) Address() string {
}
return ""
}

// SetSSHConfig can be used to set custom SSH Server settings.
func (s *SSH) SetSSHConfig(cfg *ssh.ServerConfig) {
s.sshconfig = cfg
}

// SetListener can be used to set custom Listener.
func (s *SSH) SetListener(l net.Listener) {
s.listener = l
}

0 comments on commit 90ab74a

Please sign in to comment.