minor fixes

* fix #4
* fix examples
* update go module

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
Василий Толстов 2018-12-18 00:31:40 +03:00
parent 1dfe199fe9
commit b1cfa9ee45
5 changed files with 18 additions and 21 deletions

View File

@ -3,7 +3,7 @@ MIT License
Copyright (c) 2013 Mitchell Hashimoto Copyright (c) 2013 Mitchell Hashimoto
Copyright (c) 2016-2017 Kate Ward Copyright (c) 2016-2017 Kate Ward
Copyright (c) 2017 Vasiliy Tolstov Copyright (c) 2017 Vasiliy Tolstov
Copyright (c) 2018 sdstack Copyright (c) 2018 unistack
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@ -7,7 +7,7 @@ import (
"os" "os"
"time" "time"
vnc "github.com/sdstack/go-rfb" vnc "github.com/unistack-org/go-rfb"
) )
func main() { func main() {
@ -27,7 +27,7 @@ func main() {
PixelFormat: vnc.PixelFormat32bit, PixelFormat: vnc.PixelFormat32bit,
ClientMessageCh: cchClient, ClientMessageCh: cchClient,
ServerMessageCh: cchServer, ServerMessageCh: cchServer,
ServerMessages: vnc.DefaultServerMessages, Messages: vnc.DefaultServerMessages,
Encodings: []vnc.Encoding{&vnc.RawEncoding{}}, Encodings: []vnc.Encoding{&vnc.RawEncoding{}},
ErrorCh: errorCh, ErrorCh: errorCh,
} }

View File

@ -15,7 +15,7 @@ import (
"sync" "sync"
"time" "time"
vnc "github.com/sdstack/go-rfb" vnc "github.com/unistack-org/go-rfb"
) )
type Auth struct { type Auth struct {
@ -53,7 +53,7 @@ func newConn(hostport string, password []byte) (vnc.Conn, chan vnc.ClientMessage
PixelFormat: vnc.PixelFormat32bit, PixelFormat: vnc.PixelFormat32bit,
ClientMessageCh: cchClient, ClientMessageCh: cchClient,
ServerMessageCh: cchServer, ServerMessageCh: cchServer,
ServerMessages: vnc.DefaultServerMessages, Messages: vnc.DefaultServerMessages,
Encodings: []vnc.Encoding{&vnc.RawEncoding{}}, Encodings: []vnc.Encoding{&vnc.RawEncoding{}},
ErrorCh: errorCh, ErrorCh: errorCh,
} }
@ -78,7 +78,7 @@ func handleIO(cli vnc.Conn, inp chan vnc.ClientMessage, out chan vnc.ServerMessa
ccfg := cli.Config().(*vnc.ClientConfig) ccfg := cli.Config().(*vnc.ClientConfig)
defer cli.Close() defer cli.Close()
var conns []vnc.Conn var conns []vnc.Conn
var prepared bool //var prepared bool
for { for {
select { select {
@ -247,7 +247,7 @@ func main() {
PixelFormat: vnc.PixelFormat32bit, PixelFormat: vnc.PixelFormat32bit,
ClientMessageCh: schClient, ClientMessageCh: schClient,
ServerMessageCh: schServer, ServerMessageCh: schServer,
ClientMessages: vnc.DefaultClientMessages, Messages: vnc.DefaultClientMessages,
DesktopName: []byte("vnc proxy"), DesktopName: []byte("vnc proxy"),
} }
scfg.Handlers = append(scfg.Handlers, vnc.DefaultServerHandlers...) scfg.Handlers = append(scfg.Handlers, vnc.DefaultServerHandlers...)

View File

@ -9,7 +9,7 @@ import (
"net" "net"
"time" "time"
vnc "github.com/sdstack/go-rfb" vnc "github.com/unistack-org/go-rfb"
) )
func main() { func main() {
@ -28,16 +28,13 @@ func main() {
cfg := &vnc.ServerConfig{ cfg := &vnc.ServerConfig{
Width: 800, Width: 800,
Height: 600, Height: 600,
VersionHandler: vnc.ServerVersionHandler, Handlers: vnc.DefaultServerHandlers,
SecurityHandler: vnc.ServerSecurityHandler,
SecurityHandlers: []vnc.SecurityHandler{&vnc.ClientAuthNone{}}, SecurityHandlers: []vnc.SecurityHandler{&vnc.ClientAuthNone{}},
ClientInitHandler: vnc.ServerClientInitHandler,
ServerInitHandler: vnc.ServerServerInitHandler,
Encodings: []vnc.Encoding{&vnc.RawEncoding{}}, Encodings: []vnc.Encoding{&vnc.RawEncoding{}},
PixelFormat: vnc.PixelFormat32bit, PixelFormat: vnc.PixelFormat32bit,
ClientMessageCh: chServer, ClientMessageCh: chServer,
ServerMessageCh: chClient, ServerMessageCh: chClient,
ClientMessages: vnc.DefaultClientMessages, Messages: vnc.DefaultClientMessages,
} }
go vnc.Serve(context.Background(), ln, cfg) go vnc.Serve(context.Background(), ln, cfg)

2
go.mod
View File

@ -1 +1 @@
module github.com/sdstack/go-rfb module github.com/unistack-org/go-rfb