-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMain.go
More file actions
47 lines (42 loc) · 1005 Bytes
/
Main.go
File metadata and controls
47 lines (42 loc) · 1005 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package main
import (
"com.sinlov/Golang-Android-Remote-Control/test"
"flag"
"log"
"net/http"
"os/exec"
//"com.sinlov/Golang-Android-Remote-Control/server"
"com.sinlov/Golang-Android-Remote-Control/wsVideoPlay"
"com.sinlov/Golang-Android-Remote-Control/server"
)
func main() {
server.Start_ws_server_Test("/", "/home", "server/home.html")
//start_sever()
//start_h264()
}
func start_h264() {
wsVideoPlay.Start_h264()
}
func start_sever() {
flag.Parse()
log.SetFlags(0)
test.InitServer()
http.HandleFunc("/", test.Echo)
http.HandleFunc("/home", test.Home)
log.Fatal(http.ListenAndServe(*test.Addr, nil))
}
func start_comamd() {
flag.Parse()
if len(flag.Args()) < 1 {
log.Fatal("must specify at least one argument")
}
var err error
cmdPath, err := exec.LookPath(flag.Args()[0])
if err != nil {
log.Fatal(err)
}
test.InitCommand(cmdPath)
http.HandleFunc("/", test.ServeHome)
http.HandleFunc("/ws", test.ServeWs)
log.Fatal(http.ListenAndServe(*test.Command_addr, nil))
}