|
|
|
@ -25,12 +25,14 @@ func initConfig(c *cli.Context) error { |
|
|
|
// 接收端 管理上传
|
|
|
|
func receiveClient() error { |
|
|
|
//接收者角色
|
|
|
|
go discovery.Send(discovery.Receiver) |
|
|
|
// go discovery.Send(discovery.Receiver)
|
|
|
|
//udp 模式监听
|
|
|
|
go discovery.Listen(discovery.Sender, "") |
|
|
|
// go discovery.Listen(discovery.Sender, "")
|
|
|
|
|
|
|
|
address := fmt.Sprintf("http://%s:%s", config.G.LocalIP, config.G.Port) |
|
|
|
fmt.Printf("Server address: %s\n", address) |
|
|
|
// address := fmt.Sprintf("http://%s:%s", config.G.LocalIP, config.G.Port)
|
|
|
|
// fmt.Printf("Server address: %s\n", address)
|
|
|
|
// 注释上面的局域网广播
|
|
|
|
fmt.Println("xtfs run as receive role...") |
|
|
|
|
|
|
|
http.HandleFunc("/", handler.ReceiveHandler) |
|
|
|
http.Handle("/static/", http.StripPrefix("/static/", |
|
|
|
|