You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -65,28 +63,12 @@ public function listen(ServerInterface $socket)
65
63
});
66
64
}
67
65
68
-
publicfunctionsetProtocolVersion($version)
69
-
{
70
-
if ($version !== null) {
71
-
$version = (string)$version;
72
-
if (!in_array($version, array('4', '5'), true)) {
73
-
thrownewInvalidArgumentException('Invalid protocol version given');
74
-
}
75
-
if ($version !== '5' && $this->auth !== null){
76
-
thrownewUnexpectedValueException('Unable to change protocol version to anything but SOCKS5 while authentication is used. Consider removing authentication info or sticking to SOCKS5');
77
-
}
78
-
}
79
-
$this->protocolVersion = $version;
80
-
}
81
-
82
66
publicfunctionsetAuth($auth)
83
67
{
84
68
if (!is_callable($auth)) {
85
69
thrownewInvalidArgumentException('Given authenticator is not a valid callable');
86
70
}
87
-
if ($this->protocolVersion !== null && $this->protocolVersion !== '5') {
88
-
thrownewUnexpectedValueException('Authentication requires SOCKS5. Consider using protocol version 5 or waive authentication');
89
-
}
71
+
90
72
// wrap authentication callback in order to cast its return value to a promise
91
73
$this->auth = function($username, $password, $remote) use ($auth) {
0 commit comments