Skip to content

Commit 3c7d470

Browse files
committed
Beef-up.
1 parent 9237cfc commit 3c7d470

1 file changed

Lines changed: 37 additions & 2 deletions

File tree

README.md

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,53 @@
33
## Introduction
44

55
The libasyncproxy is a fairy simple C library and a respective python wrapper,
6-
which allows connecting two sockets and relay data in/out in a background
7-
using a worker thread (one per connection at the moment).
6+
which allows splicing two sockets, pipes and in general file descriptors to
7+
relay bidirectional data in/out in a background using a worker thread (one per
8+
connection at the moment).
9+
10+
Unlike system-wide facilities that might be offering similar functionality,
11+
this library provides more control and flexibility. Allowing to connect
12+
different kinds of underlying objects (i.e. plain file to a socket, device to
13+
a pipe etc).
14+
15+
It also privides mechanism for the python code to supply a handler(s) to
16+
monitor, record and/or alter the data being transmitted.
17+
18+
Last but not least, the C library can be used directly from a low-level code
19+
for the same effect.
820

921
## History
1022

1123
The code was created to allow Python code implementing application-layer proxy
1224
to manage session routing and connection, while handling all transfers outside
1325
of confinments of the slow Python and its GIL.
1426

27+
## Interfaces
28+
29+
AsyncProxy: the lowest-level interface, dealing with raw sockets, wrapper for
30+
libasyncproxy.
31+
32+
ForwarderFast: super-set of AsyncProxy with some utility methods.
33+
34+
Forwarder: same API and functionality as ForwarderFast, but without using
35+
AsyncProxy C module (i.e. python thread doing i/o). Mostly for backward
36+
compatibility when we need to break library API.
37+
38+
TCPProxy: set of high-level classes to accept and manage inbound connections
39+
and initiate/tear-down outbound as needed, connecting them using forwarders
40+
once established. Will use ForwarderFast if available, falling back to the
41+
Forwarder if that fails.
42+
43+
## Use Cases
44+
45+
We use this library to allow applications to be redirected to one of several
46+
available DB replicas and re-routed instantly if the configuration changes.
47+
1548
## Build and Install Python module from source code:
1649

1750
```
1851
git clone https://github.com/sippy/libasyncproxy.git
1952
pip install libasyncproxy/
2053
```
54+
55+
## Usage

0 commit comments

Comments
 (0)