forked from lwch/natpass
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request lwch#15 from lwch/dev
v0.7.2
- Loading branch information
Showing
27 changed files
with
272 additions
and
538 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package process | ||
|
||
// CreateWorker create worker process | ||
func CreateWorker(name, confDir string, showCursor bool) (*Process, error) { | ||
return nil, ErrNotSupported | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package process | ||
|
||
import ( | ||
"fmt" | ||
"natpass/code/client/rule/vnc/vncnetwork" | ||
"os" | ||
"os/exec" | ||
) | ||
|
||
// CreateWorker create worker process | ||
func CreateWorker(name, confDir string, showCursor bool) (*Process, error) { | ||
dir, err := os.Executable() | ||
if err != nil { | ||
return nil, err | ||
} | ||
var p Process | ||
p.chWrite = make(chan *vncnetwork.VncMsg) | ||
p.chImage = make(chan *vncnetwork.ImageData) | ||
p.chClipboard = make(chan *vncnetwork.ClipboardData) | ||
port, err := p.listenAndServe() | ||
if err != nil { | ||
return nil, err | ||
} | ||
cmd := exec.Command(dir, "-conf", confDir, | ||
"-action", "vnc.worker", | ||
"-name", name, | ||
"-vport", fmt.Sprintf("%d", port)) | ||
err = cmd.Start() | ||
if err != nil { | ||
p.Close() | ||
return nil, err | ||
} | ||
return &p, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.