0
0
Fork 1
mirror of https://mau.dev/maunium/synapse.git synced 2024-12-14 22:03:49 +01:00

actually uphold the bind_host parameter. in theory should make ipv6 binds work like bind_host: 'fe80::1%lo0'

This commit is contained in:
Matthew Hodgson 2015-03-14 00:12:20 +00:00
parent 256fe08963
commit c8032aec17
2 changed files with 13 additions and 3 deletions

View file

@ -225,13 +225,18 @@ class SynapseHomeServer(HomeServer):
if not config.no_tls and config.bind_port is not None: if not config.no_tls and config.bind_port is not None:
reactor.listenSSL( reactor.listenSSL(
config.bind_port, Site(self.root_resource), self.tls_context_factory config.bind_port,
Site(self.root_resource),
self.tls_context_factory,
interface=config.bind_host
) )
logger.info("Synapse now listening on port %d", config.bind_port) logger.info("Synapse now listening on port %d", config.bind_port)
if config.unsecure_port is not None: if config.unsecure_port is not None:
reactor.listenTCP( reactor.listenTCP(
config.unsecure_port, Site(self.root_resource) config.unsecure_port,
Site(self.root_resource),
interface=config.bind_host
) )
logger.info("Synapse now listening on port %d", config.unsecure_port) logger.info("Synapse now listening on port %d", config.unsecure_port)

View file

@ -86,6 +86,7 @@ class JsonResource(HttpServer, resource.Resource):
self.clock = hs.get_clock() self.clock = hs.get_clock()
self.path_regexs = {} self.path_regexs = {}
self.version_string = hs.version_string self.version_string = hs.version_string
self.hs = hs
def register_path(self, method, path_pattern, callback): def register_path(self, method, path_pattern, callback):
self.path_regexs.setdefault(method, []).append( self.path_regexs.setdefault(method, []).append(
@ -99,7 +100,11 @@ class JsonResource(HttpServer, resource.Resource):
port (int): The port to listen on. port (int): The port to listen on.
""" """
reactor.listenTCP(port, server.Site(self)) reactor.listenTCP(
port,
server.Site(self),
interface=self.hs.config.bind_host
)
# Gets called by twisted # Gets called by twisted
def render(self, request): def render(self, request):