TLS: server listens on both IPv4 and IPv6

This commit is contained in:
Alberto Sottile 2019-02-03 23:11:27 +01:00
parent 8bff90d809
commit d7e577ef04

View File

@ -15,7 +15,7 @@ except AttributeError:
from OpenSSL import crypto from OpenSSL import crypto
from twisted.internet import reactor, ssl from twisted.internet import reactor, ssl
from twisted.internet.endpoints import SSL4ServerEndpoint, TCP6ServerEndpoint from twisted.internet.endpoints import SSL4ServerEndpoint
from syncplay.server import SyncFactory, ConfigurationGetter from syncplay.server import SyncFactory, ConfigurationGetter
@ -39,8 +39,8 @@ if __name__ == '__main__':
args.max_username_length, args.max_username_length,
args.stats_db_file args.stats_db_file
) )
endpoint4 = SSL4ServerEndpoint(reactor, int(args.port), certificate) endpoint4 = SSL4ServerEndpoint(reactor, int(args.port), certificate, interface='0.0.0.0')
endpoint4.listen(factory) endpoint4.listen(factory)
#endpoint6 = TCP6ServerEndpoint(reactor, int(args.port)) endpoint6 = SSL4ServerEndpoint(reactor, int(args.port), certificate, interface='::')
#endpoint6.listen(factory) endpoint6.listen(factory)
reactor.run() reactor.run()