Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F141983
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
3 KB
Subscribers
None
View Options
diff --git a/app.go b/app.go
index 47f8f8b..c8a3ec1 100644
--- a/app.go
+++ b/app.go
@@ -1,67 +1,82 @@
package sshtunnel
import (
"flag"
"log"
"golang.org/x/crypto/ssh"
-
+ "sync"
+ "os/exec"
)
func(c *Client) Start(){
-
+ var wg sync.WaitGroup
//The intermediary server for port binding
serverHostname := flag.String("server", "ubuntu.cse.unr.edu", "a string")
+
+ execPath := flag.String("exec", "", "a binary to execute after connecting.")
//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, "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
+ endpoints = append(endpoints, "7788:134.197.20.21:7788") // MATHCAD
}
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()
+ wg.Add(1)
+ go func(){
+ defer wg.Done()
+ tunnel.Start()
+ }();
+
+ cmd := exec.Command(*execPath)
+ err := cmd.Start()
+ if err != nil {
+ log.Fatal(err)
+ }
+
+ wg.Wait()
}
diff --git a/bin/README.md b/bin/README.md
new file mode 100644
index 0000000..aaee3bc
--- /dev/null
+++ b/bin/README.md
@@ -0,0 +1,3 @@
+rsrc -manifest main.manifest -ico=nevada_n_rgb_UvV_icon.ico
+
+go build
\ No newline at end of file
diff --git a/bin/main.manifest b/bin/main.manifest
new file mode 100644
index 0000000..4b567ad
--- /dev/null
+++ b/bin/main.manifest
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+ <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
+ <assemblyIdentity version="1.0.0.0" processorArchitecture="*" name="COENTunnel" type="win32"/>
+ <dependency>
+ <dependentAssembly>
+ <assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0"
+ processorArchitecture="*" publicKeyToken="6595b64144ccf1df" language="*"/>
+ </dependentAssembly>
+ </dependency>
+ </assembly>
\ No newline at end of file
diff --git a/bin/nevada_n_rgb_UvV_icon.ico b/bin/nevada_n_rgb_UvV_icon.ico
new file mode 100644
index 0000000..7d444df
Binary files /dev/null and b/bin/nevada_n_rgb_UvV_icon.ico differ
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Sat, Jun 14, 2:26 PM (1 d, 1 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15880
Default Alt Text
(3 KB)
Attached To
rST sshtunnel
Event Timeline
Log In to Comment