mirror of
https://github.com/yudai/gotty.git
synced 2026-01-06 17:48:50 +01:00
ws: enable factory to react to state of ws conn
This commit is contained in:
parent
29695481fa
commit
42d8a51a93
3 changed files with 7 additions and 3 deletions
|
|
@ -5,6 +5,7 @@ import (
|
|||
"time"
|
||||
|
||||
"github.com/ghthor/gotty/v2/server"
|
||||
"github.com/gorilla/websocket"
|
||||
)
|
||||
|
||||
type Options struct {
|
||||
|
|
@ -37,7 +38,7 @@ func (factory *Factory) Name() string {
|
|||
return "local command"
|
||||
}
|
||||
|
||||
func (factory *Factory) New(params map[string][]string) (server.Slave, error) {
|
||||
func (factory *Factory) New(params map[string][]string, conn *websocket.Conn) (server.Slave, error) {
|
||||
argv := make([]string, len(factory.argv))
|
||||
copy(argv, factory.argv)
|
||||
if params["arg"] != nil && len(params["arg"]) > 0 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue