mirror of
https://github.com/Sneed-Group/pypush-plus-plus
synced 2024-12-23 19:32:29 -06:00
small changes
This commit is contained in:
parent
6cfdab8af0
commit
54ad3295d7
2 changed files with 7 additions and 6 deletions
|
@ -61,7 +61,8 @@ def _p_filter(prefix, fields: list[tuple[int, bytes]]):
|
|||
elif field[0] == 5:
|
||||
paused.append(_lookup_topic(field[1]))
|
||||
else:
|
||||
print(f"Unknown field ID: {field[0]}")
|
||||
pass # whatever, there's a 6 but it's not documented
|
||||
#print(f"Unknown field ID: {field[0]}")
|
||||
|
||||
# Remove None values
|
||||
enabled = [topic.strip() for topic in enabled if topic is not None]
|
||||
|
@ -144,10 +145,8 @@ def pretty_print_payload(prefix, payload: tuple[int, list[tuple[int, bytes]]]) -
|
|||
print(f"{bcolors.OKGREEN}{prefix}{bcolors.ENDC}: {bcolors.OKCYAN}Keep Alive Ack{bcolors.ENDC}")
|
||||
elif id == 0x14:
|
||||
print(f"{bcolors.OKGREEN}{prefix}{bcolors.ENDC}: {bcolors.OKCYAN}Set State{bcolors.ENDC}: {_get_field(payload[1], 1).hex()}")
|
||||
elif id == 0x1d:
|
||||
print(f"{bcolors.OKGREEN}{prefix}{bcolors.ENDC}: {bcolors.FAIL}Unknown 0x1D{bcolors.ENDC}")
|
||||
elif id == 0x20:
|
||||
print(f"{bcolors.OKGREEN}{prefix}{bcolors.ENDC}: {bcolors.FAIL}Unknown 0x20{bcolors.ENDC}")
|
||||
elif id == 0x1d or id == 0x20:
|
||||
print(f"{bcolors.OKGREEN}{prefix}{bcolors.ENDC}: {bcolors.WARNING}PubSub{bcolors.ENDC}")
|
||||
elif id == 0xe:
|
||||
print(f"{bcolors.OKGREEN}{prefix}{bcolors.ENDC}: {bcolors.FAIL}Unknown 0xe{bcolors.ENDC}")
|
||||
elif id == 0xa:
|
||||
|
|
|
@ -5,7 +5,7 @@ import tlslite
|
|||
import threading
|
||||
|
||||
# APNs server to proxy traffic to
|
||||
APNS_HOST = "1-courier.push.apple.com"
|
||||
APNS_HOST = "windows.courier.push.apple.com"
|
||||
APNS_PORT = 5223
|
||||
ALPN = b"apns-security-v3"
|
||||
#ALPN = b"apns-pack-v1"
|
||||
|
@ -57,6 +57,8 @@ def proxy(conn1: tlslite.TLSConnection, conn2: tlslite.TLSConnection, prefix: st
|
|||
except OSError as e:
|
||||
if e.errno == 9:
|
||||
pass # Probably a connection closed error
|
||||
except tlslite.TLSAbruptCloseError:
|
||||
pass
|
||||
print("Connection closed")
|
||||
# Close the connections
|
||||
conn1.close()
|
||||
|
|
Loading…
Reference in a new issue