mirror of
https://github.com/amitbet/vncproxy.git
synced 2025-08-31 20:58:27 +00:00
server and client rec
This commit is contained in:
Binary file not shown.
BIN
bin/recordings/recording_1565085991/client.rbs
Normal file
BIN
bin/recordings/recording_1565085991/client.rbs
Normal file
Binary file not shown.
BIN
bin/recordings/recording_1565085991/server.rbs
Normal file
BIN
bin/recordings/recording_1565085991/server.rbs
Normal file
Binary file not shown.
BIN
bin/recordings/recording_1565086259/client.rbs
Normal file
BIN
bin/recordings/recording_1565086259/client.rbs
Normal file
Binary file not shown.
BIN
bin/recordings/recording_1565086259/server.rbs
Normal file
BIN
bin/recordings/recording_1565086259/server.rbs
Normal file
Binary file not shown.
BIN
bin/recordings/recording_1565086382/client.rbs
Normal file
BIN
bin/recordings/recording_1565086382/client.rbs
Normal file
Binary file not shown.
BIN
bin/recordings/recording_1565086382/server.rbs
Normal file
BIN
bin/recordings/recording_1565086382/server.rbs
Normal file
Binary file not shown.
BIN
bin/recordings/recording_1565093465/client.rbs
Normal file
BIN
bin/recordings/recording_1565093465/client.rbs
Normal file
Binary file not shown.
BIN
bin/recordings/recording_1565093465/server.rbs
Normal file
BIN
bin/recordings/recording_1565093465/server.rbs
Normal file
Binary file not shown.
BIN
bin/vnc_recorder
BIN
bin/vnc_recorder
Binary file not shown.
@@ -79,32 +79,43 @@ func (vp *VncProxy) newServerConnHandler(cfg *server.ServerConfig, sconn *server
|
||||
return err
|
||||
}
|
||||
|
||||
//var rec_s *ServerRecorder
|
||||
var rec_p *ProtoRecorder
|
||||
var rec_s *ServerRecorder
|
||||
var rec_c *ClientRecorder
|
||||
//var rec_p *ProtoRecorder
|
||||
|
||||
if session.Type == SessionTypeRecordingProxy {
|
||||
timeCurrent := strconv.FormatInt(time.Now().Unix(), 10)
|
||||
recFolder := path.Join(vp.RecordingDir, "recording_"+timeCurrent)
|
||||
os.MkdirAll(recFolder, os.ModePerm)
|
||||
// recServerFile := "server.rbs"
|
||||
// recServerPath := path.Join(recFolder, recServerFile)
|
||||
// rec_s, err = NewServerRecorder(recServerPath)
|
||||
// if err != nil {
|
||||
// logger.Errorf("Proxy.newServerConnHandler can't open ServerRecorder save path: %s", recServerPath)
|
||||
// return err
|
||||
// }
|
||||
|
||||
// sconn.Listeners.AddListener(rec_s)
|
||||
|
||||
recProtoFile := "proto.rbs"
|
||||
recProtoPath := path.Join(recFolder, recProtoFile)
|
||||
rec_p, err = NewProtoRecorder(recProtoPath)
|
||||
recServerFile := "server.rbs"
|
||||
recServerPath := path.Join(recFolder, recServerFile)
|
||||
rec_s, err = NewServerRecorder(recServerPath)
|
||||
if err != nil {
|
||||
logger.Errorf("Proxy.newServerConnHandler can't open ProtoRecorder save path: %s", recProtoPath)
|
||||
logger.Errorf("Proxy.newServerConnHandler can't open ServerRecorder save path: %s", recServerPath)
|
||||
return err
|
||||
}
|
||||
|
||||
sconn.Listeners.AddListener(rec_p)
|
||||
sconn.Listeners.AddListener(rec_s)
|
||||
|
||||
recClientFile := "client.rbs"
|
||||
recClientPath := path.Join(recFolder, recClientFile)
|
||||
rec_c, err = NewClientRecorder(recClientPath)
|
||||
if err != nil {
|
||||
logger.Errorf("Proxy.newServerConnHandler can't open ServerRecorder save path: %s", recClientPath)
|
||||
return err
|
||||
}
|
||||
|
||||
sconn.Listeners.AddListener(rec_c)
|
||||
|
||||
// recProtoFile := "proto.rbs"
|
||||
// recProtoPath := path.Join(recFolder, recProtoFile)
|
||||
// rec_p, err = NewProtoRecorder(recProtoPath)
|
||||
// if err != nil {
|
||||
// logger.Errorf("Proxy.newServerConnHandler can't open ProtoRecorder save path: %s", recProtoPath)
|
||||
// return err
|
||||
// }
|
||||
|
||||
// sconn.Listeners.AddListener(rec_p)
|
||||
}
|
||||
|
||||
session.Status = SessionStatusInit
|
||||
@@ -121,7 +132,8 @@ func (vp *VncProxy) newServerConnHandler(cfg *server.ServerConfig, sconn *server
|
||||
return err
|
||||
}
|
||||
if session.Type == SessionTypeRecordingProxy {
|
||||
cconn.Listeners.AddListener(rec_p)
|
||||
cconn.Listeners.AddListener(rec_s)
|
||||
cconn.Listeners.AddListener(rec_c)
|
||||
}
|
||||
|
||||
//creating cross-listeners between server and client parts to pass messages through the proxy:
|
||||
|
@@ -139,7 +139,6 @@ func (r *ServerRecorder) HandleRfbSegment(data *common.RfbSegment) error {
|
||||
switch common.ServerMessageType(data.UpcomingObjectType) {
|
||||
case common.FramebufferUpdate:
|
||||
logger.Debugf("ServerRecorder.HandleRfbSegment: saving FramebufferUpdate segment")
|
||||
//r.writeToDisk()
|
||||
case common.SetColourMapEntries:
|
||||
case common.Bell:
|
||||
case common.ServerCutText:
|
||||
@@ -168,6 +167,10 @@ func (r *ServerRecorder) HandleRfbSegment(data *common.RfbSegment) error {
|
||||
clientMsg := data.Message.(*server.MsgSetPixelFormat)
|
||||
logger.Debugf("ServerRecorder.HandleRfbSegment: client message %v", *clientMsg)
|
||||
r.serverInitMessage.PixelFormat = clientMsg.PF
|
||||
case common.KeyEventMsgType:
|
||||
r.writeToDisk()
|
||||
case common.PointerEventMsgType:
|
||||
r.writeToDisk()
|
||||
default:
|
||||
//return errors.New("unknown client message type:" + string(data.UpcomingObjectType))
|
||||
}
|
||||
|
Reference in New Issue
Block a user