[Mailman-Developers] Mailman 3: Problem with binding REST server to custom address
Tim Marx
tim at xrammit.de
Tue Feb 4 22:05:14 CET 2014
Am 03.02.2014 21:38, schrieb Barry Warsaw:
> 0.0.0.0 is a reserved IPv4 address:
>
> http://en.wikipedia.org/wiki/Reserved_IP_addresses#Reserved_IPv4_addresses
>
> so I don't think it's generally useful as an address to bind Mailman's REST
> API to, unless VB is doing something special I'm not aware of. (I'm not a VB
> expert.)
I thought it might be a good idea, because the output of 'netstat
-lntpu' in my virtual machine shows that all public accessible services
(e.g. apache2, sshd) are bound to 0.0.0.0 and these services are
accessible from the host.
The services that are bound to 127.0.0.1 can only be accessed from
localhost inside the virtual machine.
I found a simple python script and modified it a little bit:
> from wsgiref.simple_server import make_server
>
> def hello_world(environ, start_response):
> start_response('200 OK', [('Content-Type', 'text/html')])
> return ['''Hello world!''']
>
> if __name__ == '__main__':
> srv = make_server('', 8080, hello_world)
> srv.serve_forever()
This script responses "Hello world" to every request on Port 8080.
When I pass '' or '0.0.0.0' as first argument to make_server(...) I get
the expected response "Hello world" inside and outside the virtual
machine and netstat shows that the service is bound to 0.0.0.0:8080.
But when I pass '127.0.0.1' I can't access it outside the virtual
machine and netstat shows that the service is bound to 127.0.0.1:8080.
The interesting thing is netmask shows that the Mailman rest service is
always bound to 127.0.0.1 even if edit the file
src/mailman/rest/wsgiapp.py directly and change line 80 from
> host, port, make_application(),
to
> '', port, make_application(),
the rest service is bound to 127.0.0.1 and not accessible outside the
virtual machine.
This is the reason why I think it's a Mailman problem.
Thanks and Cheers,
Tim
More information about the Mailman-Developers
mailing list