libmicrohttpd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [libmicrohttpd] How to bind to a specific IP address "out of the box


From: Evgeny Grin
Subject: Re: [libmicrohttpd] How to bind to a specific IP address "out of the box"?
Date: Wed, 13 Apr 2022 10:41:10 +0300
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0

Alternatively, you can pass bind address via MHD_OPTION_SOCK_ADDR option.
So there are at least two ways how to handle it "out of the box". :)

--
Evgeny

On 13.04.2022 9:04, Christian Grothoff wrote:
You can call socket/listen/bind _before_ MHD_start_daemon() and pass the ready-made fully-configured listen socket into MHD using MHD_OPTION_LISTEN_SOCKET. The 'port' argument of MHD_start_daemon() will be ignored in this case.

On 4/13/22 02:28, silvioprog wrote:
Hey guys.

Some days ago a user asked me the following question with the attached picture:

/> Kevin said:
 > Ok, I got some more explanation from my I.T. guy.  It appears that the servers listen on 0.0.0.0 which is "All IPs on All NICs on the physical server it is running on".  > I want to have multiple different apps running on the same server, but bound only to a specific IP. I have one server app with HOST set to 1.0.125.11 port 443 and it BLOCKS the other server app from trying to run on 1.0.125.13 port 443./
/> Here is a screen shot from cports...
 > Having this capability will ELIMINATE the need to use an additional layer, like Apache/Nginx or anything. I would be running pure MHD stand alone .exes on a Windows server. Super super simple! Yipee!/

But, after looking at our MHD API, it seems we don't have any feature "out of the box" like a flag to specify the host.

So, is there any trick to handle it in pure MHD API without coding/handling sockets by hand?

Thanks in advance for any help!

image.png

--
Silvio Clécio

Attachment: OpenPGP_signature
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]