File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change
1
+ package main
2
+
3
+ import "os/exec"
4
+
5
+ func findBrowser (process string ) ([]byte , error ) {
6
+ return []byte (process ), nil
7
+ }
8
+
9
+ func killBrowser (process string ) ([]byte , error ) {
10
+ cmd := exec .Command ("pskill" , process )
11
+ return cmd .Output ()
12
+ }
13
+
14
+ func startBrowser (command []byte , url string ) ([]byte , error ) {
15
+ cmd := exec .Command ("start" , string (command ), url )
16
+ return cmd .Output ()
17
+ }
Original file line number Diff line number Diff line change @@ -241,6 +241,8 @@ func main() {
241
241
r .Handle ("WS" , "/socket.io/" , socketHandler )
242
242
r .Handle ("WSS" , "/socket.io/" , socketHandler )
243
243
r .GET ("/info" , infoHandler )
244
+ r .POST ("/killbrowser" , killBrowserHandler )
245
+
244
246
go func () {
245
247
// check if certificates exist; if not, use plain http
246
248
if _ , err := os .Stat (filepath .Join (dest , "cert.pem" )); os .IsNotExist (err ) {
You can’t perform that action at this time.
0 commit comments