Skip to content

Commit 74886dc

Browse files
authored
Merge pull request #49 from clue-labs/fix-examples
Fix examples and documentation to use `SshSocksConnector` for HTTPS
2 parents a54d304 + a41a941 commit 74886dc

4 files changed

Lines changed: 6 additions & 6 deletions

File tree

‎README.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ secure HTTPS request to google.com through a remote SSH server:
7979

8080
require __DIR__ . '/vendor/autoload.php';
8181

82-
$proxy = new Clue\React\SshProxy\SshProcessConnector('alice@example.com');
82+
$proxy = new Clue\React\SshProxy\SshSocksConnector('alice@example.com');
8383

8484
$connector = new React\Socket\Connector(array(
8585
'tcp' => $proxy,
@@ -404,7 +404,7 @@ $connection->query('SELECT * FROM book')->then(
404404
$connection->quit();
405405
```
406406

407-
See also [example #21](examples) for more details.
407+
See also [example #31](examples) for more details.
408408

409409
This example will automatically launch the `ssh` client binary to create the
410410
connection to a database server that can not otherwise be accessed from the

‎examples/01-https-request.php‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
// A simple example which uses an HTTP client to requesthttps://example.com/ through an SSH proxy server.
3+
// A simple example which uses an HTTP client to request https://example.com/ through an SSH proxy server.
44
// The proxy can be given through the SSH_PROXY env and defaults to localhost otherwise.
55
//
66
// You can assign the SSH_PROXY environment and prefix this with a space to make
@@ -13,7 +13,7 @@
1313

1414
$url = getenv('SSH_PROXY') !== false ? getenv('SSH_PROXY') : 'alice@localhost';
1515

16-
$proxy = new Clue\React\SshProxy\SshProcessConnector($url);
16+
$proxy = new Clue\React\SshProxy\SshSocksConnector($url);
1717

1818
$connector = new React\Socket\Connector(array(
1919
'tcp' => $proxy,

‎examples/02-optional-proxy-https-request.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
// SSH_PROXY environment given? use this as the proxy URL
1515
$connector = null;
1616
if (getenv('SSH_PROXY') !== false) {
17-
$proxy = new Clue\React\SshProxy\SshProcessConnector(getenv('SSH_PROXY'));
17+
$proxy = new Clue\React\SshProxy\SshSocksConnector(getenv('SSH_PROXY'));
1818

1919
$connector = new React\Socket\Connector(array(
2020
'tcp' => $proxy,

‎examples/22-optional-proxy-raw-https-protocol.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
// SSH_PROXY environment given? use this as the proxy URL
2222
if (getenv('SSH_PROXY') !== false) {
23-
$proxy = new Clue\React\SshProxy\SshProcessConnector(getenv('SSH_PROXY'));
23+
$proxy = new Clue\React\SshProxy\SshSocksConnector(getenv('SSH_PROXY'));
2424

2525
$connector = new React\Socket\Connector(array(
2626
'tcp' => $proxy,

0 commit comments

Comments
 (0)