libmicrohttpd
[Top][All Lists]
Advanced

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

Re: [libmicrohttpd] running libmicrohttpd on a particular interface


From: Baldur Gislason
Subject: Re: [libmicrohttpd] running libmicrohttpd on a particular interface
Date: Tue, 13 Apr 2010 13:45:25 +0000

Yes, create a sockaddr struct like so:
  struct sockaddr_in address;
  address.sin_family = AF_INET;
  address.sin_port = htons(80);
  inet_pton(AF_INET, (argc < 3) ? "0.0.0.0" : argv[1], &address.sin_addr);

Then pass this to MHD_start_daemon as an option.

errpage, MHD_OPTION_SOCK_ADDR, &address, MHD_OPTION_END);

Baldur

On Tue, Apr 13, 2010 at 1:00 AM, K Q <address@hidden> wrote:
> Hi,
>
> In addition to specifying the port to listen to, is it possible to specify
> an interface?
>
> In particular, I would like to confine my software service to
> localhost:<port>
>
> Thanks,
>
> Ken
>
> ________________________________
> Your E-mail and More On-the-Go. Get Windows Live Hotmail Free. Sign up now.




reply via email to

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