Background: I’m using a ruby gem called bane which in turn uses GServer to listen for HTTP connections.
According to this other stackoverflow question, by default GServer uses the DEFAULT_HOST when listening, which is set to 127.0.0.1.
Problem: I want bane to listen on 0.0.0.0 (that is, all incoming connections, not just from locallhost). Rather than hack bane’s source to allow an IP address to be specified, is there a way to override the default host in some way?
Two options come to mind:
1) Override the GServer constant
In case you’re not using GServer for anything else, then this approach will give you
0.0.0.0globally.2) Monkey patch Bane