You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+137-1Lines changed: 137 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -38,7 +38,7 @@ compatibility when we need to break library API.
38
38
TCPProxy: set of high-level classes to accept and manage inbound connections
39
39
and initiate/tear-down outbound as needed, connecting them using forwarders
40
40
once established. Will use ForwarderFast if available, falling back to the
41
-
Forwarder if that fails.
41
+
Forwarder if that fails to load or initialize.
42
42
43
43
## Use Cases
44
44
@@ -53,3 +53,139 @@ pip install libasyncproxy/
53
53
```
54
54
55
55
## Usage
56
+
57
+
### libasyncproxy — `AsyncProxy2FD` Example
58
+
59
+
This example shows how to set up a bidirectional relay between two socket pairs using `AsyncProxy2FD`. Data sent on one end is forwarded to the other, and vice versa.
60
+
61
+
```python
62
+
import socket
63
+
from libasyncproxy.AsyncProxy import AsyncProxy2FD
64
+
65
+
# 1. Create two socket pairs:
66
+
# - (client_socket, proxy_in): client writes to `proxy_in`
67
+
# - (proxy_out, server_socket): proxy writes to `proxy_out`, server reads
0 commit comments