H2, how does setting -webAllowOthers work?

I start the H2 console from spring:

<spring:bean id="H2WebServer" class="org.h2.tools.Server" scope="singleton" factory-method="createWebServer" init-method="start" destroy-method="stop"> <spring:constructor-arg value="-web,-webAllowOthers,true,-webPort,8082" /> </spring:bean> 

Version H2 - 1.3.160

I do not want the console to be accessible to other computers on my network. The documentation says that you need to use the webAllowOthers parameter to enable / disable other computers. But if I set "-webAllowOthers, false", the console is still available on my local network. I also checked the .h2.server.properties file.

How to set up work?

+4
source share
2 answers

If you do not want to allow other computers, remove -webAllowOthers:

how

 <spring:constructor-arg value="-web,-webPort,8082" /> 

else save only -webAllowOthers

 <spring:constructor-arg value="-web,-webAllowOthers,-webPort,8082" /> 

If the setting is deleted, he answers "Sorry, remote connections are disconnected on this server."

+2
source

You can always use firewall rules;) iptables on linux, etc.

+1
source

Source: https://habr.com/ru/post/1393151/


All Articles