minor fixes
* fix #4 * fix examples * update go module Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
parent
1dfe199fe9
commit
b1cfa9ee45
2
LICENSE
2
LICENSE
@ -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
|
||||||
|
@ -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,
|
||||||
}
|
}
|
||||||
|
@ -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...)
|
||||||
|
@ -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() {
|
||||||
@ -26,18 +26,15 @@ func main() {
|
|||||||
defer tick.Stop()
|
defer tick.Stop()
|
||||||
|
|
||||||
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{}},
|
Encodings: []vnc.Encoding{&vnc.RawEncoding{}},
|
||||||
ClientInitHandler: vnc.ServerClientInitHandler,
|
PixelFormat: vnc.PixelFormat32bit,
|
||||||
ServerInitHandler: vnc.ServerServerInitHandler,
|
ClientMessageCh: chServer,
|
||||||
Encodings: []vnc.Encoding{&vnc.RawEncoding{}},
|
ServerMessageCh: chClient,
|
||||||
PixelFormat: vnc.PixelFormat32bit,
|
Messages: vnc.DefaultClientMessages,
|
||||||
ClientMessageCh: chServer,
|
|
||||||
ServerMessageCh: chClient,
|
|
||||||
ClientMessages: vnc.DefaultClientMessages,
|
|
||||||
}
|
}
|
||||||
go vnc.Serve(context.Background(), ln, cfg)
|
go vnc.Serve(context.Background(), ln, cfg)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user