Skip to content

Commit f60ae62

Browse files
committed
Prepare v1.0.0 release
1 parent 9db7fa7 commit f60ae62

3 files changed

Lines changed: 139 additions & 18 deletions

File tree

CHANGELOG.md

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,87 @@
11
# Changelog
22

3+
## 1.0.0 (2018-11-20)
4+
5+
* First stable release, now following SemVer!
6+
7+
* Feature / BC break: Unify SOCKS5 and SOCKS4(a) protocol version handling,
8+
the `Client` now defaults to SOCKS5 instead of SOCKS4a,
9+
remove explicit SOCKS4a handling and merge into SOCKS4 protocol handling and
10+
URI scheme `socks5://` now only acts as an alias for default `socks://` scheme.
11+
(#74, #81 and #87 by @clue)
12+
13+
```php
14+
// old: defaults to SOCKS4a
15+
$client = new Client('127.0.0.1:1080', $connector);
16+
$client = new Client('socks://127.0.0.1:1080', $connector);
17+
18+
// new: defaults to SOCKS5
19+
$client = new Client('127.0.0.1:1080', $connector);
20+
$client = new Client('socks://127.0.0.1:1080', $connector);
21+
22+
// new: explicitly use legacy SOCKS4(a)
23+
$client = new Client('socks4://127.0.0.1:1080', $connector);
24+
25+
// unchanged: explicitly use SOCKS5
26+
$client = new Client('socks5://127.0.0.1:1080', $connector);
27+
```
28+
29+
* Feature / BC break: Clean up `Server` interface,
30+
add `Server::listen()` method instead of accepting socket in constructor,
31+
replace `Server::setAuth()` with optional constructor parameter,
32+
remove undocumented "connection" event from Server and drop explicit Evenement dependency and
33+
mark all classes as `final` and all internal APIs as `@internal`
34+
(#78, #79, #80 and #84 by @clue)
35+
36+
```php
37+
// old: socket passed to server constructor
38+
$socket = new React\Socket\Server(1080, $loop);
39+
$server = new Clue\React\Socks\Server($loop, $socket);
40+
41+
// old: authentication via setAuthArray()/setAuth() methods
42+
$server = new Clue\React\Socks\Server($loop, $socket);
43+
$server->setAuthArray(array(
44+
'tom' => 'password',
45+
'admin' => 'root'
46+
));
47+
48+
// new: socket passed to listen() method
49+
$server = new Clue\React\Socks\Server($loop);
50+
$socket = new React\Socket\Server(1080, $loop);
51+
$server->listen($socket);
52+
53+
// new: authentication passed to server constructor
54+
$server = new Clue\React\Socks\Server($loop, null, array(
55+
'tom' => 'password',
56+
'admin' => 'root'
57+
));
58+
$server->listen($socket);
59+
```
60+
61+
* Feature: Improve error reporting for failed connections attempts by always including target URI in exceptions and
62+
improve promise cancellation and clean up any garbage references.
63+
(#82 and #83 by @clue)
64+
65+
All error messages now always contain a reference to the remote URI to give
66+
more details which connection actually failed and the reason for this error.
67+
Similarly, any underlying connection issues to the proxy server will now be
68+
reported as part of the previous exception.
69+
70+
For most common use cases this means that simply reporting the `Exception`
71+
message should give the most relevant details for any connection issues:
72+
73+
```php
74+
$promise = $proxy->connect('tcp://example.com:80');
75+
$promise->then(function (ConnectionInterface $connection) {
76+
// …
77+
}, function (Exception $e) {
78+
echo $e->getMessage();
79+
});
80+
```
81+
82+
* Improve documentation and examples, link to other projects and update project homepage.
83+
(#73, #75 and #85 by @clue)
84+
385
## 0.8.7 (2017-12-17)
486

587
* Feature: Support SOCKS over TLS (`sockss://` URI scheme)

README.md

Lines changed: 56 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,39 @@
11
# clue/reactphp-socks [![Build Status](https://travis-ci.org/clue/reactphp-socks.svg?branch=master)](https://travis-ci.org/clue/reactphp-socks)
22

3-
Async SOCKS proxy connector client and server implementation, use any TCP/IP-based
3+
Async SOCKS proxy connector client and server implementation, tunnel any TCP/IP-based
44
protocol through a SOCKS5 or SOCKS4(a) proxy server, built on top of
55
[ReactPHP](https://reactphp.org).
66

7-
The SOCKS protocol family can be used to easily tunnel TCP connections independent
8-
of the actual application level protocol, such as HTTP, SMTP, IMAP, Telnet etc.
7+
The SOCKS proxy protocol family (SOCKS5, SOCKS4 and SOCKS4a) is commonly used to
8+
tunnel HTTP(S) traffic through an intermediary ("proxy"), to conceal the origin
9+
address (anonymity) or to circumvent address blocking (geoblocking). While many
10+
(public) SOCKS proxy servers often limit this to HTTP(S) port `80` and `443`
11+
only, this can technically be used to tunnel any TCP/IP-based protocol (HTTP,
12+
SMTP, IMAP etc.).
13+
This library provides a simple API to create these tunneled connections for you.
14+
Because it implements ReactPHP's standard
15+
[`ConnectorInterface`](https://github.com/reactphp/socket#connectorinterface),
16+
it can simply be used in place of a normal connector.
17+
This makes it fairly simple to add SOCKS proxy support to pretty much any
18+
existing higher-level protocol implementation.
19+
Besides the client side, it also provides a simple SOCKS server implementation
20+
which allows you to build your own SOCKS proxy servers with custom business logic.
21+
22+
* **Async execution of connections** -
23+
Send any number of SOCKS requests in parallel and process their
24+
responses as soon as results come in.
25+
The Promise-based design provides a *sane* interface to working with out of
26+
bound responses and possible connection errors.
27+
* **Standard interfaces** -
28+
Allows easy integration with existing higher-level components by implementing
29+
ReactPHP's standard
30+
[`ConnectorInterface`](https://github.com/reactphp/socket#connectorinterface).
31+
* **Lightweight, SOLID design** -
32+
Provides a thin abstraction that is [*just good enough*](https://en.wikipedia.org/wiki/Principle_of_good_enough)
33+
and does not get in your way.
34+
Builds on top of well-tested components and well-established concepts instead of reinventing the wheel.
35+
* **Good test coverage** -
36+
Comes with an automated tests suite and is regularly tested against actual proxy servers in the wild.
937

1038
**Table of contents**
1139

@@ -255,10 +283,10 @@ a generic proxy allowing higher level application protocols to work through it.
255283
</tr>
256284
<tr>
257285
<th>Protocol specification</th>
258-
<td><a href="http://tools.ietf.org/html/rfc1928">RFC 1928</a></td>
286+
<td><a href="https://tools.ietf.org/html/rfc1928">RFC 1928</a></td>
259287
<td>
260-
<a href="http://ftp.icm.edu.pl/packages/socks/socks4/SOCKS4.protocol">SOCKS4.protocol</a> /
261-
<a href="http://ftp.icm.edu.pl/packages/socks/socks4/SOCKS4A.protocol">SOCKS4A.protocol</a>
288+
<a href="https://ftp.icm.edu.pl/packages/socks/socks4/SOCKS4.protocol">SOCKS4.protocol</a> /
289+
<a href="https://ftp.icm.edu.pl/packages/socks/socks4/SOCKS4A.protocol">SOCKS4A.protocol</a>
262290
</td>
263291
</tr>
264292
<tr>
@@ -278,7 +306,7 @@ a generic proxy allowing higher level application protocols to work through it.
278306
</tr>
279307
<tr>
280308
<th><a href="#authentication">Username/Password authentication</a></th>
281-
<td>✓ (as per <a href="http://tools.ietf.org/html/rfc1929">RFC 1929</a>)</td>
309+
<td>✓ (as per <a href="https://tools.ietf.org/html/rfc1929">RFC 1929</a>)</td>
282310
<td>✗</td>
283311
</tr>
284312
<tr>
@@ -385,7 +413,7 @@ as usual.
385413
#### Authentication
386414

387415
This library supports username/password authentication for SOCKS5 servers as
388-
defined in [RFC 1929](http://tools.ietf.org/html/rfc1929).
416+
defined in [RFC 1929](https://tools.ietf.org/html/rfc1929).
389417

390418
On the client side, simply pass your username and password to use for
391419
authentication (see below).
@@ -927,32 +955,40 @@ $client = new Client('socks+unix:///tmp/proxy.sock', $connector);
927955

928956
### Using the Tor (anonymity network) to tunnel SOCKS connections
929957

930-
The [Tor anonymity network](http://www.torproject.org) client software is designed
958+
The [Tor anonymity network](https://www.torproject.org) client software is designed
931959
to encrypt your traffic and route it over a network of several nodes to conceal its origin.
932960
It presents a SOCKS5 and SOCKS4(a) interface on TCP port 9050 by default
933-
which allows you to tunnel any traffic through the anonymity network.
934-
In most scenarios you probably don't want your client to resolve the target hostnames,
935-
because you would leak DNS information to anybody observing your local traffic.
936-
Also, Tor provides hidden services through an `.onion` pseudo top-level domain
937-
which have to be resolved by Tor.
961+
which allows you to tunnel any traffic through the anonymity network:
938962

939-
```PHP
963+
```php
940964
$client = new Client('127.0.0.1:9050', $connector);
941965
```
942966

967+
In most common scenarios you probably want to stick to default
968+
[remote DNS resolution](#dns-resolution) and don't want your client to resolve the target hostnames,
969+
because you would leak DNS information to anybody observing your local traffic.
970+
Also, Tor provides hidden services through an `.onion` pseudo top-level domain
971+
which have to be resolved by Tor.
972+
943973
## Install
944974

945975
The recommended way to install this library is [through Composer](https://getcomposer.org).
946976
[New to Composer?](https://getcomposer.org/doc/00-intro.md)
947977

978+
This project follows [SemVer](https://semver.org/).
948979
This will install the latest supported version:
949980

950981
```bash
951-
$ composer require clue/socks-react:^0.8.7
982+
$ composer require clue/socks-react:^1.0
952983
```
953984

954985
See also the [CHANGELOG](CHANGELOG.md) for details about version upgrades.
955986

987+
This project aims to run on any platform and thus does not require any PHP
988+
extensions and supports running on legacy PHP 5.3 through current PHP 7+ and
989+
HHVM.
990+
It's *highly recommended to use PHP 7+* for this project.
991+
956992
## Tests
957993

958994
To run the test suite, you first need to clone this repo and then install all
@@ -977,7 +1013,10 @@ $ php vendor/bin/phpunit --exclude-group internet
9771013

9781014
## License
9791015

980-
MIT, see LICENSE
1016+
This project is released under the permissive [MIT license](LICENSE).
1017+
1018+
> Did you know that I offer custom development services and issuing invoices for
1019+
sponsorships of releases and for contributions? Contact me (@clue) for details.
9811020

9821021
## More
9831022

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "clue/socks-react",
3-
"description": "Async SOCKS proxy connector client and server implementation, use any TCP/IP-based protocol through a SOCKS5 or SOCKS4(a) proxy server, built on top of ReactPHP.",
3+
"description": "Async SOCKS proxy connector client and server implementation, tunnel any TCP/IP-based protocol through a SOCKS5 or SOCKS4(a) proxy server, built on top of ReactPHP.",
44
"keywords": ["socks client", "socks server", "socks5", "socks4a", "proxy server", "tcp tunnel", "async", "ReactPHP"],
55
"homepage": "https://github.com/clue/reactphp-socks",
66
"license": "MIT",

0 commit comments

Comments
 (0)