Skip to content

Commit

Permalink
Add client-side support for packet fragmenting and use 0.0.0.0 instea…
Browse files Browse the repository at this point in the history
…d of localhost.
  • Loading branch information
Bigjango13 committed Apr 26, 2022
1 parent 1e51480 commit 616d2e9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
3 changes: 1 addition & 2 deletions pyper/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ def getHostname(ip: str, port: int, path: str, args: dict = {}) -> str:
:return: hostname"""
hostname = "piper://" if not ip.startswith("piper://") else ""
hostname += ip
if port != 60:
hostname += ":" + str(port)
hostname += ":" + str(port)
if path not in ["/", ""]:
if not path.startswith("/"):
hostname += "/"
Expand Down
4 changes: 2 additions & 2 deletions pyper/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ def __init__(self, port=60):
:type port: int"""
self.port = port
self.serverClass = PyperTCPServer
self.server = socketserver.TCPServer(("localhost", port), self.serverClass)
self.server = socketserver.TCPServer(("0.0.0.0", port), self.serverClass)
self.server.allow_reuse_address = True

def start(self):
"""Starts the pyper server"""
print("Started server on localhost:" + str(self.port) + ".")
print("Started server on 0.0.0.0:" + str(self.port) + ".")
print("Ctrl+C to quit.")
try:
with self.server:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

setup(
name="pyper-piper",
version="0.1.5",
version="0.1.6",
description="The Piper networking protocol in Python.",
url="https://github.com/Bigjango13/Pyper",
author="Bigjango13",
Expand Down

0 comments on commit 616d2e9

Please sign in to comment.