#1 2026-07-28 14:56:28

zensan
Member
Registered: 2015-07-29
Posts: 14

Http Server: How to bind to localhost/127.0.0.1 using useHttpAsync?

Good day, Arnaud!

When we use useHttpApiRegisteringURIOnly with TSQLHttpServer and provide the address 127.0.0.1 (instead of '+'). It works as expected and is not reachable from 192.168.xxx.xxx or any external IP.

But if we use useHttpAsync (which i suppose is the optimal option) then the parameter is ignored and server binds on 0.0.0.0 whatever we pass.

The reason we need it, because after a penetration test the security company reported that the services listen to the addresses they should not.

So it works fine useHttpApiRegisteringURIOnly but requires admin rights (first time) even for localhost! Can't socket's implementation/fallback also consume that parameter or is there a way to force that?

Thanks you in advance.

Last edited by zensan (2026-07-28 15:00:19)

Offline

#2 2026-07-28 19:35:38

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 15,564
Website

Re: Http Server: How to bind to localhost/127.0.0.1 using useHttpAsync?

You could specify an IP to the "Port" field.
For instance Port = '8888' will bind 0.0.0.0:8888 but Port = '127.0.0.1:8888' will only bind 127.0.0.1.

Offline

#3 2026-07-29 06:37:19

zensan
Member
Registered: 2015-07-29
Posts: 14

Re: Http Server: How to bind to localhost/127.0.0.1 using useHttpAsync?

Thank you! You are the best smile

Offline

Board footer

Powered by FluxBB