|
@@ -3,10 +3,12 @@ package main
|
|
|
import (
|
|
|
"flag"
|
|
|
"fmt"
|
|
|
+ "github.com/gogf/gf/frame/g"
|
|
|
+ "github.com/gogf/gf/net/ghttp"
|
|
|
)
|
|
|
|
|
|
var (
|
|
|
- testURL = flag.String("url", "http://192.168.0.167:8088", "login url")
|
|
|
+ testURL = flag.String("url", "http://192.168.0.224:18100", "login url")
|
|
|
testProductKey = flag.String("productkey", "958daf8b3a533f0d9516ac8fd17ef0cb06b439e664787a2a89608a10eeee8eb3c35c82c505d19f8a4417e530de0678fd", "product key")
|
|
|
testProtocol = flag.String("protocol", "mqtt", "access protocol")
|
|
|
)
|
|
@@ -37,5 +39,11 @@ func main() {
|
|
|
fmt.Printf("device access error %s", err)
|
|
|
return
|
|
|
}
|
|
|
-
|
|
|
+ go func() {
|
|
|
+ s := g.Server()
|
|
|
+ s.BindHandler("/", func(r *ghttp.Request) {
|
|
|
+ r.Response.Write("哈喽世界!")
|
|
|
+ })
|
|
|
+ s.Run()
|
|
|
+ }()
|
|
|
}
|