mirror of
https://github.com/lwch/natpass
synced 2025-10-30 06:56:19 +08:00
21 lines
424 B
Go
21 lines
424 B
Go
package vnc
|
|
|
|
import (
|
|
"fmt"
|
|
"natpass/code/client/rule/vnc/worker"
|
|
|
|
"github.com/gorilla/websocket"
|
|
"github.com/lwch/runtime"
|
|
)
|
|
|
|
// RunWorker run vnc worker
|
|
func RunWorker(port uint16, cursor bool) {
|
|
worker := worker.NewWorker(cursor)
|
|
if worker == nil {
|
|
panic("build context failed")
|
|
}
|
|
conn, _, err := websocket.DefaultDialer.Dial(fmt.Sprintf("ws://127.0.0.1:%d", port), nil)
|
|
runtime.Assert(err)
|
|
worker.Do(conn)
|
|
}
|