mirror of
https://github.com/amitbet/vncproxy.git
synced 2025-09-10 09:29:12 +00:00
created proxy and listeners to connect recorder and server-client cross writing
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user