30 lines
837 B
Go
30 lines
837 B
Go
|
package main
|
||
|
|
||
|
import (
|
||
|
"github.com/BRNSystems/go-telnet"
|
||
|
"sync"
|
||
|
)
|
||
|
|
||
|
var clients []*Client
|
||
|
var clientsMutex sync.Mutex
|
||
|
|
||
|
func main() {
|
||
|
addr := ":6969"
|
||
|
commandRegistry := NewCommandRegistry()
|
||
|
termHandler := NewInternalTerminalHandler("# ",
|
||
|
` ____ _ _ ____ _ _ _
|
||
|
/ ___|| |__ ___ | |_ __ _ _ _ _ __ | _ \ ___ _ _| | ___| |_| |_ ___
|
||
|
\___ \| '_ \ / _ \| __/ _`+"`"+` | | | | '_ \ | |_) / _ \| | | | |/ _ \ __| __/ _ \
|
||
|
___) | | | | (_) | || (_| | |_| | | | | | _ < (_) | |_| | | __/ |_| || __/
|
||
|
|____/|_| |_|\___/ \__\__, |\__,_|_| |_| |_| \_\___/ \__,_|_|\___|\__|\__\___|
|
||
|
|___/`,
|
||
|
commandRegistry)
|
||
|
|
||
|
// Register commands
|
||
|
RegisterCommands(commandRegistry)
|
||
|
|
||
|
if err := telnet.ListenAndServe(addr, termHandler); nil != err {
|
||
|
panic(err)
|
||
|
}
|
||
|
}
|