diff --git a/.idea/libraries/GOPATH__sshtunnel_.xml b/.idea/libraries/GOPATH__sshtunnel_.xml deleted file mode 100644 index 5aff23e..0000000 --- a/.idea/libraries/GOPATH__sshtunnel_.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app.go b/app.go index 35fd1af..47f8f8b 100644 --- a/app.go +++ b/app.go @@ -1,68 +1,67 @@ package sshtunnel import ( "flag" "log" "golang.org/x/crypto/ssh" ) func(c *Client) Start(){ //The intermediary server for port binding serverHostname := flag.String("server", "ubuntu.cse.unr.edu", "a string") //TODO Add logfile //TODO Add exec - Executes an application. var endpoints EndpointsFlag flag.Var(&endpoints,"endpoints", "Local and remote endpoints") flag.Parse() if len(endpoints) < 1 { log.Printf("No endpoints defined: %d\n", len(endpoints)) - endpoints = make(EndpointsFlag, 0) - endpoints = append(endpoints, "27013:172.28.128.230:27013") - endpoints = append(endpoints, "8080:134.197.20.220:80") - endpoints = append(endpoints, "5555:172.28.128.230:5555") - + endpoints = append(endpoints, "5555:172.28.128.230:5555") // MATLAB + endpoints = append(endpoints, "25734:172.28.128.230:25734") // SolidWorks + endpoints = append(endpoints, "25735:172.28.128.230:25735") // SolidWorks + endpoints = append(endpoints, "7788:134.197.20.21:7788") // SolidWorks } localE, remoteE:= ParseEndpointsFromArray(endpoints) log.Printf("localE: %v remoteE: %v", localE, remoteE) // 27013 serverEndpoint := &Endpoint{ Host: *serverHostname, Port: 22, } log.Printf("Endpoints: %v \nserverEndpoint: %v\n", endpoints, serverEndpoint) //log.Printf("%v %v", serverEndpoint) //credChan := make(chan Credentials) var passwordForm= NewPasswordForm() //passwordForm.SetChan(credChan) passwordForm.Show(); credentials := passwordForm.Credentials log.Printf("Connecting to %s, User: %s ", *serverHostname, credentials.Username) sshConfig := &ssh.ClientConfig{ User: credentials.Username, HostKeyCallback: KeyPrint, Auth: []ssh.AuthMethod{ ssh.Password(credentials.Password), }, } tunnel := &SSHtunnel{ Config: sshConfig, Local: localE, Server: serverEndpoint, Remote: remoteE, } tunnel.Start() }