From df9c6fe7677c9f585e7623f78ed607eb25c602f2 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 27 Mar 2011 20:18:52 -0600 Subject: [PATCH] Add a tweak that can be used to have the calibre content server listen for IPv6 connections. Fixes #743486 (library/server/ doesn't listen on ipv6) --- resources/default_tweaks.py | 8 ++++++++ src/calibre/library/server/__init__.py | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/resources/default_tweaks.py b/resources/default_tweaks.py index 464c9d2cfd..1cf699efa3 100644 --- a/resources/default_tweaks.py +++ b/resources/default_tweaks.py @@ -363,3 +363,11 @@ maximum_cover_size = (1200, 1600) # the files will be sent to the location with the most free space. send_news_to_device_location = "main" +#: What interfaces should the content server listen on +# By default, the calibre content server listens on '0.0.0.0' which means that it +# accepts IPv4 connections on all interfaces. You can change this to, for +# example, '127.0.0.1' to only listen for connections from the local machine, or +# to '::' to listen to all incoming IPv6 and IPv4 connections (this may not +# work on all operating systems) +server_listen_on = '0.0.0.0' + diff --git a/src/calibre/library/server/__init__.py b/src/calibre/library/server/__init__.py index 244669f50a..950c881d8d 100644 --- a/src/calibre/library/server/__init__.py +++ b/src/calibre/library/server/__init__.py @@ -10,7 +10,7 @@ import os from calibre.utils.config import Config, StringConfig, config_dir, tweaks -listen_on = '0.0.0.0' +listen_on = tweaks['server_listen_on'] log_access_file = os.path.join(config_dir, 'server_access_log.txt')