'How to bind Spring Boot LiveReload server to localhost only?

I've installed the Spring Boot Developer tools. After running the application, I've noticed that the LiveReload server open by default the TCP port 35729 on all network interfaces (eth0, lo, ...).

I've seen that I can disable this server with :

spring.devtools.livereload.enabled=false

but I would like to keep the LiveReload server running only on localhost.

How to do it?



Solution 1:[1]

Assuming in dev you use localhost and in prod not using localhost

Write in application-dev.properties not in application-prod.properties That way you can use only in localhost

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Satish Patro