Skip to content
This repository has been archived by the owner on May 22, 2020. It is now read-only.

Commit

Permalink
Now speaks IPv6, if config contains a ":" in host
Browse files Browse the repository at this point in the history
  • Loading branch information
Bandie Canis committed Oct 2, 2017
1 parent 43bac5e commit 0363518
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion ding_client
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,10 @@ def main():
print("Please check your paths in the config file. (Have you forgotten to generate the Certificates?)", sep="", file=sys.stderr)
quit(2)

conn = context.wrap_socket(socket.socket())
if(":" in host):
conn = context.wrap_socket(socket.socket(family=socket.AF_INET6))
else:
conn = context.wrap_socket(socket.socket(family=socket.AF_INET))


try:
Expand Down
5 changes: 4 additions & 1 deletion ding_server
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,10 @@ def init():
quit(2)

try:
bindsocket = socket.socket()
if(":" in host):
bindsocket = socket.socket(family=socket.AF_INET6)
else:
bindsocket = socket.socket(family=socket.AF_INET)
bindsocket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
bindsocket.bind((host, port))
bindsocket.listen(5)
Expand Down

0 comments on commit 0363518

Please sign in to comment.