pfrelay 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pfrelay/__init__.py +95 -0
- pfrelay/_client.py +1064 -0
- pfrelay/_conn.py +580 -0
- pfrelay/_forward.py +186 -0
- pfrelay/_proto.py +437 -0
- pfrelay/_ws.py +404 -0
- pfrelay-0.1.0.dist-info/METADATA +252 -0
- pfrelay-0.1.0.dist-info/RECORD +11 -0
- pfrelay-0.1.0.dist-info/WHEEL +5 -0
- pfrelay-0.1.0.dist-info/licenses/LICENSE +202 -0
- pfrelay-0.1.0.dist-info/top_level.txt +1 -0
pfrelay/__init__.py
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
"""pfrelay: the Python SDK for the pf-simple relay hub.
|
|
2
|
+
|
|
3
|
+
Serve a tunnel or connect through one from your own asyncio program. The
|
|
4
|
+
protocol is described in docs/PROTOCOL.md of the pf-simple repository.
|
|
5
|
+
|
|
6
|
+
client = pfrelay.Client("https://hub.example.com", "k3f9-x2mq-7hpa",
|
|
7
|
+
serve_token=TOKEN, name="Office SSH")
|
|
8
|
+
listener = await client.listen()
|
|
9
|
+
conn = await listener.accept()
|
|
10
|
+
"""
|
|
11
|
+
|
|
12
|
+
from ._client import (
|
|
13
|
+
DEFAULT_AGENT,
|
|
14
|
+
LISTEN_BACKLOG,
|
|
15
|
+
DEFAULT_MAX_IDLE_LEGS,
|
|
16
|
+
REASON_BACKLOG,
|
|
17
|
+
REASON_LEG_LOST,
|
|
18
|
+
REASON_STOPPED,
|
|
19
|
+
REASON_UNREACHABLE,
|
|
20
|
+
Client,
|
|
21
|
+
Events,
|
|
22
|
+
Listener,
|
|
23
|
+
__version__,
|
|
24
|
+
split_host_port,
|
|
25
|
+
)
|
|
26
|
+
from ._conn import ConnInfo, Conn, Stats
|
|
27
|
+
from ._proto import (
|
|
28
|
+
PROTO_MAX,
|
|
29
|
+
PROTO_MIN,
|
|
30
|
+
AccessDenied,
|
|
31
|
+
ClosedError,
|
|
32
|
+
ConnID,
|
|
33
|
+
DroppedError,
|
|
34
|
+
Endpoint,
|
|
35
|
+
Feature,
|
|
36
|
+
LinkError,
|
|
37
|
+
PfRelayError,
|
|
38
|
+
ProtoError,
|
|
39
|
+
RemoteError,
|
|
40
|
+
ServerInfo,
|
|
41
|
+
Side,
|
|
42
|
+
StatusError,
|
|
43
|
+
check_client_token,
|
|
44
|
+
check_serve_token,
|
|
45
|
+
new_word,
|
|
46
|
+
normalize_word,
|
|
47
|
+
parse_proto_range,
|
|
48
|
+
proto_range,
|
|
49
|
+
)
|
|
50
|
+
|
|
51
|
+
STDIO_TARGET = "stdio"
|
|
52
|
+
|
|
53
|
+
import logging as _logging
|
|
54
|
+
|
|
55
|
+
_logging.getLogger("pfrelay").addHandler(_logging.NullHandler())
|
|
56
|
+
|
|
57
|
+
__all__ = [
|
|
58
|
+
"__version__",
|
|
59
|
+
"DEFAULT_AGENT",
|
|
60
|
+
"LISTEN_BACKLOG",
|
|
61
|
+
"PROTO_MIN",
|
|
62
|
+
"PROTO_MAX",
|
|
63
|
+
"STDIO_TARGET",
|
|
64
|
+
"DEFAULT_MAX_IDLE_LEGS",
|
|
65
|
+
"REASON_BACKLOG",
|
|
66
|
+
"REASON_LEG_LOST",
|
|
67
|
+
"REASON_STOPPED",
|
|
68
|
+
"REASON_UNREACHABLE",
|
|
69
|
+
"Client",
|
|
70
|
+
"Events",
|
|
71
|
+
"Listener",
|
|
72
|
+
"ConnID",
|
|
73
|
+
"Side",
|
|
74
|
+
"Endpoint",
|
|
75
|
+
"DroppedError",
|
|
76
|
+
"Conn",
|
|
77
|
+
"ConnInfo",
|
|
78
|
+
"Stats",
|
|
79
|
+
"ServerInfo",
|
|
80
|
+
"Feature",
|
|
81
|
+
"PfRelayError",
|
|
82
|
+
"StatusError",
|
|
83
|
+
"AccessDenied",
|
|
84
|
+
"ProtoError",
|
|
85
|
+
"RemoteError",
|
|
86
|
+
"LinkError",
|
|
87
|
+
"ClosedError",
|
|
88
|
+
"split_host_port",
|
|
89
|
+
"new_word",
|
|
90
|
+
"normalize_word",
|
|
91
|
+
"check_serve_token",
|
|
92
|
+
"check_client_token",
|
|
93
|
+
"proto_range",
|
|
94
|
+
"parse_proto_range",
|
|
95
|
+
]
|