Skip to content

Commit

Permalink
Require amphp/http-tunnel and switch to Socks5SocketConnector (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
danog authored Feb 12, 2025
1 parent f2b745b commit 6841908
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"amphp/dns": "^2.2",
"amphp/http-client": "^5",
"amphp/http-client-psr7": "^1",
"amphp/http-tunnel": "^2.0",
"amphp/socket": "^2.3",
"guzzlehttp/guzzle": "^7",
"guzzlehttp/promises": "^1 || ^2",
Expand All @@ -42,7 +43,6 @@
},
"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
4 changes: 2 additions & 2 deletions src/GuzzleHandlerAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@
use Amp\Http\Client\Response;
use Amp\Http\Tunnel\Http1TunnelConnector;
use Amp\Http\Tunnel\Https1TunnelConnector;
use Amp\Http\Tunnel\Socks5TunnelConnector;
use Amp\Socket\Certificate;
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 @@ -255,7 +255,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 6841908

Please sign in to comment.