created proxy and listeners to connect recorder and server-client cross writing

This commit is contained in:
amit bezalel
2017-07-09 09:51:17 +03:00
parent d40b7670d5
commit 86938a8d76
18 changed files with 1224 additions and 950 deletions

View File

@@ -1,16 +1,20 @@
package server
import (
"context"
"log"
"testing"
"vncproxy/common"
"vncproxy/encodings"
)
func newServerConnHandler(cfg *ServerConfig, conn *ServerConn) error {
return nil
}
func TestServer(t *testing.T) {
chServer := make(chan common.ClientMessage)
//chServer := make(chan common.ClientMessage)
chClient := make(chan common.ServerMessage)
cfg := &ServerConfig{
@@ -18,16 +22,17 @@ func TestServer(t *testing.T) {
SecurityHandlers: []SecurityHandler{&ServerAuthVNC{"Ch_#!T@8"}},
Encodings: []common.Encoding{&encodings.RawEncoding{}, &encodings.TightEncoding{}, &encodings.CopyRectEncoding{}},
PixelFormat: common.NewPixelFormat(32),
ClientMessageCh: chServer,
ServerMessageCh: chClient,
ClientMessages: DefaultClientMessages,
DesktopName: []byte("workDesk"),
Height: uint16(768),
Width: uint16(1024),
//ClientMessageCh: chServer,
ServerMessageCh: chClient,
ClientMessages: DefaultClientMessages,
DesktopName: []byte("workDesk"),
Height: uint16(768),
Width: uint16(1024),
NewConnHandler: newServerConnHandler,
}
url := "http://localhost:8091/"
go WsServe(url, context.Background(), cfg)
go TcpServe(":5903", context.Background(), cfg)
go WsServe(url, cfg)
go TcpServe(":5903", cfg)
// Process messages coming in on the ClientMessage channel.
for {
msg := <-chClient