Now I have the following code extracted from a book.
package main
import (
"net/http"
)
func main() {
h := http.FileServer(http.Dir("."))
http.ListenAndServeTLS(":8001", "rui.crt", "rui.key", h)
}
I expect it can list all the file in the folder of main.go
but when I browse to:
https://localhost:8001
I can only see:
This site can’t be reached.
localhost refused to connect.
I use LiteIDE to build and run the program. After BuildAndRun clicked, the following messages are shown.
F:/Go/bin/go.exe build -i [E:/Users/User/Desktop/codespace_v2.6.6/dev/server_side/golang/go_codespace_v2.1/server]
Success: process exited with code 0.
E:/Users/User/Desktop/codespace_v2.6.6/dev/server_side/golang/go_codespace_v2.1/server/server.exe [E:/Users/User/Desktop/codespace_v2.6.6/dev/server_side/golang/go_codespace_v2.1/server]
Success: process exited with code 0.
Why and how can I fix it?