File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1010use React \EventLoop \LoopInterface ;
1111use React \SocketClient \ConnectorInterface ;
1212use React \SocketClient \SecureConnector ;
13+ use Socks \Connector ;
1314use \Exception ;
1415use \InvalidArgumentException ;
1516use \UnexpectedValueException ;
@@ -117,6 +118,11 @@ public function createSecureConnector()
117118 {
118119 return new SecureConnector ($ this ->createConnector (), $ this ->loop );
119120 }
121+
122+ public function createConnector ()
123+ {
124+ return new Connector ($ this );
125+ }
120126
121127 public function getConnection ($ host , $ port )
122128 {
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Socks ;
4+
5+ use React \SocketClient \ConnectorInterface ;
6+ use Socks \Client ;
7+
8+ class Connector implements ConnectorInterface
9+ {
10+ private $ client ;
11+
12+ public function __construct (Client $ socksClient )
13+ {
14+ $ this ->client = $ socksClient ;
15+ }
16+
17+ public function create ($ host , $ port )
18+ {
19+ return $ this ->client ->getConnection ($ host , $ port );
20+ }
21+ }
You can’t perform that action at this time.
0 commit comments