Skip to content

Commit 1cdcb1a

Browse files
Updated README.
1 parent 6fbf711 commit 1cdcb1a

File tree

1 file changed

+46
-30
lines changed

1 file changed

+46
-30
lines changed

README.md

+46-30
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
This repository is home to Pluggable Transport Adapter, a Python 3 package that
2-
interfaces with Tor's pluggable transports, and obfs4-standalone-tunnel, a set
3-
of scripts to run pluggable transports as TCP tunnel.
2+
interfaces with Tor's pluggable transports, plus a script to run pluggable
3+
transports as TCP tunnel.
44

5-
**This project REQUIRES Python 3.4 or higher.** It only depends on the standard
6-
library, not on any optional packages.
5+
**This project REQUIRES Python 3.4.2 or higher.** Other than the standard
6+
library, it has no dependencies.
77

88
## Motivation
99
The motivation for this project comes from the desire of running
@@ -15,34 +15,42 @@ so I implemented enough of [Tor's pluggable transport specification]
1515
support standalone operation as server or client, in a way that's hopefully
1616
reusable for other projects.
1717

18-
# pluggabletransportadapter
18+
# ptadapter
19+
20+
The package used to be called `pluggabletransportadapter`, but that name is
21+
rather long and cumbersome, so it has been renamed to the shorter version.
1922

2023
This package implements Tor's pluggable transport protocol, in order to run
2124
and control pluggable transports (PT).
2225

23-
This package requires Python 3.4 or higher.
26+
This package requires Python 3.4.2 or higher.
27+
28+
These classes are implemented: `PTServerAdapter`, `PTClientSOCKSAdapter`,
29+
`PTClientStreamAdapter`, `PTClientListeningAdapter`.
2430

25-
It implements 3 classes: `PluggableTransportServerAdapter`,
26-
`PluggableTransportClientSOCKSAdapter` and `PluggableTransportClientTCPAdapter`.
31+
`PTServerAdapter` runs PT executable as a server, listening on TCP ports for
32+
obfuscated traffic and forwards plaintext traffic to a given address:port.
33+
Obfuscated traffic hit the PT executable directly, and unobfuscated traffic
34+
is emitted by the PT executable; the script has no idea about client
35+
connections.
2736

28-
`PluggableTransportServerAdapter` runs PT executable as a server, listening on
29-
a TCP port for obfuscated traffic and forwards plaintext traffic to a given
30-
address:port.
37+
`PTClientSOCKSAdapter` runs PT executable as a client, where the PT listens on
38+
an address:port of its choice, accepts either SOCKS4 or SOCKS5 connection
39+
attempts, obfuscates the traffic and forwards it to a server.
3140

32-
`PluggableTransportClientSOCKSAdapter` runs PT executable as a client, where the
33-
PT listens on address:port of its choice, accepts either SOCKS4 or SOCKS5
34-
connection attempts, obfuscates the traffic and forwards it to a server.
41+
`PTClientStreamAdapter` does what `PTClientSOCKSAdapter` does, and provides
42+
convenient methods for creating StreamReader/Writer pairs that talks through the
43+
PT.
3544

36-
`PluggableTransportClientTCPAdapter` runs PT executable as a client and
37-
additionally handles SOCKS reverse proxying, accepting plaintext traffic
38-
directly on a TCP address:port.
45+
`PTClientListeningAdapter` does what `PTClientStreamAdapter` does. In addition
46+
it listens for plaintext traffic on a TCP address:port and forwards them
47+
through the PT.
3948

40-
# obfs4-standalone-tunnel
49+
# The script
4150

42-
The two scripts, `standalone_server.py` and `standalone_client.py`, are wrappers
43-
around the `pluggabletransportadapter` libary. They allow running pluggable
44-
transports such as `obfs4proxy` as standalone servers and clients, creating
45-
obfuscated tunnels carrying TCP traffic.
51+
The script `standalone.py` allows running pluggable transports such as
52+
`obfs4proxy` as standalone servers and clients. Run one copy as client and
53+
another as server to create obfuscated tunnels.
4654

4755
## Requirements
4856

@@ -56,7 +64,7 @@ to download a zip package, or just checkout with git.
5664
distributions you can install them from the package repository. For Windows, it
5765
might be easiest to extract the binary from Tor Browser Bundle.
5866

59-
* Python 3.4 or higher for your operating system.
67+
* Python 3.4.2 or higher for your operating system.
6068

6169
## Configuration
6270

@@ -71,12 +79,20 @@ persistent and writable. After first run, the server will save its keys to the
7179
states directory and read it from there for future runs. It will also write the
7280
appropriate client parameters there.
7381

74-
# Ideas for Future Work
82+
## Some notes
7583

76-
Now that the reverse proxy is written in `asyncio`, it might make sense to rewrite
77-
the subprocess handling asynchronously as well.
84+
The reason I'm targetting Python 3.4.2 is that Debian Jessie has that version
85+
in the official repository, and it has `loop.create_task()` so I don't have to
86+
use `asyncio.async()` where `async` is a reserved keyword in Python 3.5 and
87+
later.
88+
89+
Since communication to the PT executable is now via `asyncio` subprocess pipes,
90+
on Windows the event loop must be a `ProactorEventLoop`, not the default
91+
`SelectorEventLoop`.
92+
93+
# Ideas for Future Work
7894

79-
Also, with the script now being able to communicate to PT directly, implementing
80-
Extended ORPort support should not be too difficult. Extended ORPort would give
81-
us more detailed logging info for connected clients, as well as per-connection
82-
bandwidth control.
95+
Extended ORPort support is still work in progress. Turns out per-connection
96+
bandwidth control and throttling was never implemented in Tor and PTs, so the
97+
only benefit of ExtORPort is that the server script can know where clients are
98+
connecting from, and potentially refuse connections.

0 commit comments

Comments
 (0)