Skip to content

Commit 518451a

Browse files
committed
Spawn http webserver as a goroutine
1 parent 3cc5325 commit 518451a

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

main.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ func main() {
139139
}
140140

141141
if *hasDownloadFile {
142-
http.ListenAndServe(*networkPort, http.FileServer(http.Dir(filepath.Dir(*sketchPath))))
142+
go http.ListenAndServe(":"+*networkPort, http.FileServer(http.Dir(filepath.Dir(*sketchPath))))
143143
// find my ip if not specified
144144
ip := getMyIP(net.ParseIP(*networkAddress))
145145
url := "http://" + ip.String() + ":" + *networkPort + "/" + filepath.Base(*sketchPath)
@@ -257,7 +257,6 @@ func getMyIP(otherip net.IP) net.IP {
257257
case *net.IPAddr:
258258
ips = append(ips, v.IP)
259259
}
260-
// process IP address
261260
}
262261
}
263262
return nil

0 commit comments

Comments
 (0)