listen on 0.0.0.0?

22 views
Skip to first unread message

James Turk

unread,
Oct 4, 2011, 2:55:42 PM10/4/11
to superfa...@googlegroups.com
I am working on setting up our first real production instance of SFM and I'm to the point where I need it speaking to another machine but I have been unable to successfully use the -address flag.

Generally 0.0.0.0 will configure a server to listen on all IPs, but in this case the validation layer seems to reject it "socket error: expr=0.0.0.0:80 msg=invalid address expression"

Is there a way to get SFM to support listening on all IPs instead of just localhost?

(Also I'm happy to help update the documentation to include the command line switches if you'd like, finding them was a bit challenging at first but I'm comfortable with most of them now)

Donovan Hide

unread,
Oct 4, 2011, 3:25:28 PM10/4/11
to superfa...@googlegroups.com
Hi James,

good news on the production front! Also massive new and faster commit is heading your way very soon :)

The any IP address binding is a bit of a drag. It's actually a validation error in Kyoto Tycoon (ktsocket.cc 253-256):

  if (kc::atoi(addr) < 1 || port < 1 || port > kc::INT16MAX) {
    sockseterrmsg(core, "invalid address expression");
    return false;
  }

The guard:

kc::atoi(addr) < 1

perhaps should be:

kc::atoi(addr) >=0

and is possibly a bug. I'll fire an email off to Mikio and see if he'll fix it for a future release. The workaround if to specify the external IP address, rather than 0.0.0.0 - this is only a limitation if you want to bind to more than one address. If you're using EC2 the Elastic IP is the one to go for. Another alternative is to proxy the SFM instance with nginx or apache and continue binding to 127.0.0.1, but this is a bit of a faff!

Any documentation much appreciated! Obviously, superfastmatch --help shows the basics, but if you want to make a HTML file with some tips and extra info it could sit nicely in the help section of the running instance itself (ie. in the templates folder)?

Cheers,
Donny.
Reply all
Reply to author
Forward
0 new messages