add simple Hello "world"
This commit is contained in:
parent
8fc7fced07
commit
1f17e45e60
19
_example/simple/simple.go
Normal file
19
_example/simple/simple.go
Normal file
@ -0,0 +1,19 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"io"
|
||||
"log"
|
||||
|
||||
"github.com/hloeffler/ssh"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
||||
ssh.Handle(func(s ssh.Session) {
|
||||
user := s.User()
|
||||
io.WriteString(s, "Hello "+user+"\n")
|
||||
})
|
||||
|
||||
log.Fatal(ssh.ListenAndServe(":2222", nil))
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user