Skip to content

Commit

Permalink
moved and parametrized the recorder
Browse files Browse the repository at this point in the history
  • Loading branch information
amit bezalel committed Aug 3, 2017
1 parent 8a510da commit 39d74c9
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"remotePath": "",
"port": 2345,
"host": "127.0.0.1",
"program": "${workspaceRoot}/",
"program": "${workspaceRoot}/recorder/cmd",
"osx": {
"env": {
//"GOPATH": "${env.HOME}/Dropbox/go"
Expand All @@ -66,7 +66,7 @@
//"GOPATH": "${env.USERPROFILE}\\Dropbox\\go"
}
},
"args": [],
"args": ["-recDir","/Users/amitbet/vncRec/recording.rbs", "-targPort","5903","-targPass","Ch_#!T@8"],
"showLog": true
},
{
Expand Down
2 changes: 1 addition & 1 deletion player/player_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func TestServer(t *testing.T) {
cfg.NewConnHandler = func(cfg *server.ServerConfig, conn *server.ServerConn) error {
//fbs, err := loadFbsFile("/Users/amitbet/Dropbox/recording.rbs", conn)
//fbs, err := loadFbsFile("/Users/amitbet/vncRec/recording.rbs", conn)
fbs, err := ConnectFbsFile("/Users/amitbet/vncRec/recording1500554806.rbs", conn)
fbs, err := ConnectFbsFile("/Users/amitbet/vncRec/recording.rbs", conn)

if err != nil {
logger.Error("TestServer.NewConnHandler: Error in loading FBS: ", err)
Expand Down
2 changes: 0 additions & 2 deletions proxy/cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@ package main

import "vncproxy/proxy"
import "flag"
import "fmt"
import "vncproxy/logger"
import "os"

func main() {
fmt.Println("running!")
//create default session if required
var tcpPort = flag.String("tcpPort", "", "tcp port")
var wsPort = flag.String("wsPort", "", "websocket port")
Expand Down
15 changes: 12 additions & 3 deletions main.go → recorder/cmd/main.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package main

import (
"flag"
"net"
"time"
"vncproxy/client"
Expand All @@ -11,20 +12,28 @@ import (
)

func main() {
// var tcpPort = flag.String("tcpPort", "", "tcp port")
// var wsPort = flag.String("wsPort", "", "websocket port")
// var vncPass = flag.String("vncPass", "", "password on incoming vnc connections to the proxy, defaults to no password")
var recordDir = flag.String("recDir", "", "path to save FBS recordings WILL NOT RECORD IF EMPTY.")
var targetVncPort = flag.String("targPort", "", "target vnc server port")
var targetVncPass = flag.String("targPass", "", "target vnc password")

flag.Parse()

//nc, err := net.Dial("tcp", "192.168.1.101:5903")
nc, err := net.Dial("tcp", "localhost:5903")
nc, err := net.Dial("tcp", "localhost:"+*targetVncPort)

if err != nil {
logger.Errorf("error connecting to vnc server: %s", err)
}
var noauth client.ClientAuthNone
authArr := []client.ClientAuth{&client.PasswordAuth{Password: "Ch_#!T@8"}, &noauth}
authArr := []client.ClientAuth{&client.PasswordAuth{Password: *targetVncPass}, &noauth}

//vncSrvMessagesChan := make(chan common.ServerMessage)

//rec, err := recorder.NewRecorder("c:/Users/betzalel/recording.rbs")
rec, err := recorder.NewRecorder("/Users/amitbet/vncRec/recording.rbs")
rec, err := recorder.NewRecorder(*recordDir) //"/Users/amitbet/vncRec/recording.rbs")
if err != nil {
logger.Errorf("error creating recorder: %s", err)
return
Expand Down

0 comments on commit 39d74c9

Please sign in to comment.