View Ticket
Not logged in
Ticket UUID: 812379bd1ac5b2b21dbfc169495df3bf672679cc
Title: "fossil ui" network interface option
Status: Open Type: Feature_Request
Severity: Important Priority:
Subsystem: Resolution: Open
Last Modified: 2010-02-11 01:41:54
Version Found In: f969b6cdde
Description & Comments:
Currently there is "--port" option to set port number. To accomplish, there should be also --interface option to bind only to selected interface. To hide server from some networks. Or to start different instances on single port.

anonymous added on 2010-02-10 20:11:36:
Actually quite simple (at least for Unix). I'm just fiddling around with it. So far I added -IP parameter and parsing via
zIP = find_option("IP", 0, 1);
and changed call to
cgi_http_server(zIP, iPort, mxPort, zBrowserCmd)
Next step, change INADDR_ANY in cgi.c to
inaddr.sin_addr.s_addr = inet_addr(zIP);
So far so good. But now it's about dealing with defaults (ie no -IP parameter), dealing with "localhost" instead of "127.0.0.1", having a default in the global fossil db. That's where I am having troubles now.

Anyway, specifying an listening IP address is actually piece of cake :-)


anonymous added on 2010-02-10 20:14:07:
Ooops, I forgot: another step might be to default to 127.0.0.1 when invoking with "fossil ui" instead of "fossil server". That's at least the behaviour I prefer with those different invocations.


anonymous claiming to be ge added on 2010-02-11 01:41:54:
New code should really use the getaddrinfo call to convert the address and port information into one or more struct sockaddr values. It's a bit more involved but it gets you compatibility with IPv6 almost for free.