Added IPv6 support (#73)

* Added IPv6 support

* Updated docker images to IPv6 usage

* Reverted commented entry point from testing. Sry.
This commit is contained in:
Simonmicro 2020-07-08 22:45:44 +02:00 committed by GitHub
parent 3d203cbe1d
commit 9d9a3639e1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 4 deletions

View File

@ -2,7 +2,7 @@
FROM alpine:3.8
ENV IP 0.0.0.0
ENV IP ::
ENV PORT 1688
ENV EPID ""
ENV LCID 1033

View File

@ -9,8 +9,8 @@ FROM alpine:3.8
# EN: IP-address
# RU: IP-адрес
ENV IP 0.0.0.0
# The IP address to listen on. The default is "0.0.0.0" (all interfaces).
ENV IP ::
# The IP address to listen on. The default is "::" (all interfaces).
# EN: TCP-port
# RU: TCP-порт
@ -115,4 +115,4 @@ WORKDIR /home/py-kms
EXPOSE ${PORT}/tcp
# Entry point
ENTRYPOINT ["/usr/bin/start.sh"]
ENTRYPOINT ["/usr/bin/start.sh"]

View File

@ -36,6 +36,7 @@ class KeyServer(socketserver.ThreadingMixIn, socketserver.TCPServer):
allow_reuse_address = True
def __init__(self, server_address, RequestHandlerClass):
self.address_family = socket.AF_INET6 # This call make sure the server creates an IPv6 socket and NOT an IPv4 by default
socketserver.TCPServer.__init__(self, server_address, RequestHandlerClass)
self.__shutdown_request = False
self.r_service, self.w_service = os.pipe()