Only allow local requests

This commit is contained in:
Junegunn Choi
2022-12-31 23:13:14 +09:00
parent 924ffb5a35
commit ec20dfe312

View File

@@ -24,7 +24,7 @@ func startHttpServer(port int, channel chan []*action) error {
return nil
}
listener, err := net.Listen("tcp", fmt.Sprintf(":%d", port))
listener, err := net.Listen("tcp", fmt.Sprintf("localhost:%d", port))
if err != nil {
return fmt.Errorf("port not available: %d", port)
}