Skip to content

Commit

Permalink
Require amphp/http-tunnel and switch to Socks5SocketConnector
Browse files Browse the repository at this point in the history
  • Loading branch information
danog committed Feb 10, 2025
1 parent 7e59a4a commit 95581a7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@
"guzzlehttp/psr7": "^1 || ^2",
"psr/http-message": "^1.1 || ^2",
"psr/http-factory-implementation": "^1",
"revolt/event-loop": "^1"
"revolt/event-loop": "^1",
"amphp/http-tunnel": "^2.0"
},
"require-dev": {
"amphp/file": "^3.0",
"amphp/http-tunnel": "^2",
"amphp/php-cs-fixer-config": "^2",
"amphp/phpunit-util": "^3",
"phpunit/phpunit": "^9",
Expand Down
3 changes: 2 additions & 1 deletion src/GuzzleHandlerAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
use Amp\Socket\ClientTlsContext;
use Amp\Socket\ConnectContext;
use Amp\Socket\SocketConnector;
use Amp\Socket\Socks5SocketConnector;
use AssertionError;
use GuzzleHttp\Promise\Promise;
use GuzzleHttp\Promise\PromiseInterface;
Expand Down Expand Up @@ -251,7 +252,7 @@ private static function getConnector(AmpRequest $request, array $options): ?Sock
if ($userInfo !== '') {
[$user, $password] = \explode(':', $userInfo, 2) + [null, null];
}
return new Socks5TunnelConnector($uri->getHost() . ':' . $uri->getPort(), $user, $password);
return new Socks5SocketConnector($uri->getHost() . ':' . $uri->getPort(), $user, $password);
}

$headers = [];
Expand Down

0 comments on commit 95581a7

Please sign in to comment.